sisyo 1.10.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,404 @@
1
+ # g6-style app screens
2
+
3
+ The product behind the homepage: the signed-in app, a team console, a shop, public pages, an admin, print. Built only
4
+ from the kit in `components.md`, with the tokens of `tokens.md`. App screens are calm: almost no motion (CSS
5
+ `animate-pop-in` / `animate-rise` on arrival, nothing looping), feedback inline, one gold key per view.
6
+
7
+ ## 1. The app's page shell (a "My page")
8
+
9
+ - One route with tabs read from `?tab=` (works in a static export). Layout `mx-auto max-w-7xl px-4 pt-6 pb-28 lg:grid
10
+ lg:grid-cols-[15rem_minmax(0,1fr)] lg:gap-10 lg:pt-8`; content column `mt-5 min-w-0 lg:mt-0`; a banner slot above
11
+ every tab `mb-5 space-y-2 empty:hidden`.
12
+ - **PC sidebar** `hidden lg:block` → `sticky top-20 space-y-5`: groups with a heading `px-3 pb-1 text-[11px] font-bold
13
+ tracking-wider text-muted`; items with an icon in the tab's tone; active `tone-{t} bg-surface font-bold text-ink-title
14
+ shadow-edge ring-1 ring-line` plus a lit bar on the left edge `before:absolute before:inset-y-2 before:left-0
15
+ before:w-1 before:rounded-full before:bg-tone before:shadow-[0_0_10px_var(--tone)]`; idle `text-ink-soft
16
+ hover:bg-surface/70`. A switcher (which profile) sits on top; on phones above the tab content.
17
+ - **Phone menu** in the header slot (`components.md` §8): a toggle pill showing the current tab (`tone-{t} flex h-9
18
+ min-w-0 items-center gap-1.5 rounded-full bg-tone/12 pr-2.5 pl-2 text-[13px] font-bold text-ink-title ring-1
19
+ ring-inset`, `ring-tone/55`, open `ring-tone shadow-glow-sm`: the tab's glowing icon, its name `max-w-[6.5rem]
20
+ truncate` (hidden below 360 px), a menu / close icon) that opens a panel under the header, portalled to `<body>`: scrim `fixed inset-x-0 top-14
21
+ bottom-0 z-40 bg-black/30 backdrop-blur-[1px]`, holder `fixed inset-x-0 top-14 z-40 max-h-[calc(100dvh-3.5rem)]
22
+ overflow-y-auto`, panel `mx-auto max-w-md animate-pop-in rounded-card bg-surface p-2 shadow-float ring-1
23
+ ring-line-strong`, items a `grid grid-cols-2 gap-1.5` of tiles (active `bg-tone/15 font-bold ring-2 ring-tone/70`).
24
+ Closes on a pick, the scrim, Esc and a tab change.
25
+ - **Tab tones** follow the tone meanings: profiles / card scans / account bronze; themes / blog / designs rose;
26
+ contacts / visits / support champagne; orders amber; billing coin.
27
+ - Tab header: `flex items-center gap-1.5` with an h2 `text-xl font-bold text-ink-title` and an InfoTip, the lead `mt-1
28
+ text-sm text-muted`. Content width per tab: `max-w-3xl` forms, `max-w-4xl` billing, `max-w-5xl` settings in `grid
29
+ gap-4 lg:grid-cols-2 lg:items-start`.
30
+ - Page states: skeleton `mx-auto h-64 max-w-md animate-pulse px-4 pt-10` → `h-full rounded-card bg-surface-2`;
31
+ signed out: a centred muted line and a full-width sign-in key; a load error `text-center text-sm text-danger`.
32
+
33
+ ## 2. Editor beside a live phone preview
34
+
35
+ - `lg:grid lg:grid-cols-[minmax(0,1fr)_340px] lg:gap-10`: the form `min-w-0 space-y-4 pb-24 lg:pb-0`, the preview
36
+ `hidden lg:block` → `sticky top-20 flex flex-col items-center gap-3`, a caption `text-xs font-bold tracking-wider
37
+ text-muted` over the live phone (`components.md` §13, `scale` 0.78). The preview renders the same components as the
38
+ public page, from the unsaved form state, so what you see is what visitors get.
39
+ - Phones: a `secondary` 「プレビュー」 key in the save bar (`lg:hidden`) opens a sheet with the phone at 0.7. A
40
+ preview that needs the whole screen (a design studio) uses the full sheet; fit its scale to the screen:
41
+ `min((W − 48) / 399, (H × .92 − 110) / 836, .9)`, never below 0.5.
42
+ - When phone and PC layouts differ in structure (an iframe preview), decide in JS with `matchMedia('(min-width:
43
+ 64rem)')` so the heavy part exists once, not twice behind `hidden`.
44
+ - Columns that depend on the room a component has (an editor between a menu and a preview) use container queries
45
+ (`@container` on a wrapper, then `@md:` / `@3xl:`), never screen breakpoints: at 1024 px the column is narrow.
46
+
47
+ ## 3. Section cards and settings rows
48
+
49
+ - Section: `<Card padding="lg">` → `mb-4 flex items-center gap-1.5` (h2 `text-lg font-bold text-ink-title` + InfoTip);
50
+ with actions `flex flex-wrap items-center justify-between gap-3`. A heading with a meaning gets a 24 px toned icon.
51
+ - **Rows that move**: arrow buttons, not drag and drop (works with a thumb, a keyboard and a screen reader): `flex
52
+ size-9 items-center justify-center rounded-xl text-muted hover:bg-surface-2 disabled:opacity-30` for up, down,
53
+ delete. Row `rounded-card border border-line bg-surface p-3 shadow-edge`; a row someone else controls (a team
54
+ admin) `bg-surface-2/60` with a lock icon and a short line why.
55
+ - **Add tiles**: `@container` → `grid grid-cols-4 gap-2 @md:grid-cols-6`, tile `rounded-control border border-line
56
+ bg-surface px-1 py-2.5 text-xs font-bold shadow-edge hover:-translate-y-px hover:border-gold/70 hover:shadow-glow-sm`
57
+ with a truncating label. A new row renders synchronously (`flushSync`), then its input is scrolled to the centre and
58
+ focused **inside the tap**, so a phone opens its keyboard.
59
+ - **Radio tiles**: checked `bg-gold/10 ring-2 ring-gold/70`, keyboard focus `has-[:focus-visible]:ring-4
60
+ has-[:focus-visible]:ring-champagne/40`.
61
+ - **A setting that saves on its own** (a switch): change at once, roll back on failure, a result line under it
62
+ `mt-2 text-xs text-success` (`role="status"`, 「保存しました」 cleared after 2 s) or `text-danger` (`role="alert"`).
63
+ - Lists: `ul divide-y divide-line` in a card, rows `p-4 sm:p-5`.
64
+ - **Segmented control**: track `inline-flex rounded-full bg-surface-2 p-1 ring-1 ring-line`, item `inline-flex h-9
65
+ items-center gap-1.5 rounded-full px-4 text-sm font-bold`, on `bg-surface text-ink-title shadow-sm ring-1 ring-line`,
66
+ off `text-muted hover:text-ink-title` (links with `aria-current` when they change the URL). Filters and periods:
67
+ chips. A tab list where the choice is strong: gold pills (`bg-gold font-bold text-on-gold shadow-glow-sm`).
68
+ - Disclosure: `<details class="group">` with a chevron `group-open:rotate-180`.
69
+
70
+ ## 4. Save bar and feedback
71
+
72
+ - **Save bar**, fixed at every width: `fixed inset-x-0 bottom-0 z-40 border-t border-line bg-surface-base/85 px-4 pt-3
73
+ pb-[max(0.75rem,env(safe-area-inset-bottom))] backdrop-blur-xl` → `mx-auto flex max-w-6xl items-center gap-2`: a
74
+ status line `min-w-0 flex-1 truncate text-sm` (muted 「未保存の変更があります」, success, or danger with
75
+ `role="alert"`), the phone preview key, and the gold key `size lg min-w-32` disabled while nothing changed or while
76
+ saving (「保存しています…」). The page reserves room under it (`pb-28`).
77
+ - **No toasts.** Feedback stays where the eye is: the save bar's line, a `role="status"` line that clears itself
78
+ (~2 s), a copy button that swaps its icon for a success check, and banners at the top of the tab.
79
+ - **Banner**: `tone-{coin|gold|amber} flex items-start gap-3 rounded-card bg-tone/12 p-3 ring-1 ring-tone/45
80
+ ring-inset sm:p-4`, an icon or a spinner, the text, an optional `size-9` dismiss. A payment that takes a while walks
81
+ amber "waiting" (spinner) → amber "slow" (a reload key) → gold "done".
82
+ - **Success medallion** (setup done, order placed): `animate-pop-in rounded-full bg-gold-face text-on-gold
83
+ shadow-[inset_0_1px_0_rgb(255_255_255/.6),0_4px_0_#9a6f22,0_0_28px_rgb(242_199_110/.45)]` with a check.
84
+ - **Chat composers and sheet footers** stick to the bottom: `sticky bottom-0 z-20 -mx-4 border-t border-line
85
+ bg-surface-base/90 px-4 pt-2.5 pb-[max(0.75rem,env(safe-area-inset-bottom))] backdrop-blur-xl` (from `lg` a
86
+ floating card: `lg:bottom-4 lg:rounded-card lg:shadow-float`); inside a sheet `sticky -bottom-5 -mx-5 -mb-5 border-t
87
+ border-line bg-surface px-5 py-3`.
88
+
89
+ ## 5. Empty, loading, error
90
+
91
+ - Empty: `rounded-card border border-dashed border-line-strong p-6 text-center text-sm text-muted` (say what to do,
92
+ with the add action next to it); an empty chat shows the AI's greeting and starter chips.
93
+ - Skeleton: `animate-pulse rounded-card bg-surface-2` blocks the size of the content (`h-32` ×2 in `grid gap-3
94
+ lg:grid-cols-2`), `aria-busy` on the region.
95
+ - Spinner: `size-4 animate-spin rounded-full border-2 border-gold border-t-transparent` (`size-8 border-4` for a
96
+ pane). Long lists: a sentinel (`h-px`) that loads more, plus a ghost 「もっと見る」 key as the fallback.
97
+ - Error: `text-sm text-danger` with `role="alert"` and an outline 「再試行」 key with a refresh icon; boxed:
98
+ `rounded-control bg-coral/10 px-3 py-2 text-sm text-danger ring-1 ring-coral/40 ring-inset`; a warning is the same
99
+ in amber (`bg-amber/12 ring-amber/45`, `text-warning`).
100
+ - A test / demo mode banner: `rounded-card border border-amber/45 bg-amber/12 px-4 py-3`.
101
+
102
+ ## 6. A paid feature on a free account
103
+
104
+ One flow for every lock: any locked action calls `onLocked(feature)`, which opens one **offer sheet** (the free trial
105
+ if never taken, else the plans), its first line a lock icon in coin and a bold title naming the feature.
106
+
107
+ - **Locked panel** (a whole tab): `<Card tone="coin" padding="lg" class="max-w-3xl space-y-4">`, a lock disc `flex
108
+ size-10 items-center justify-center rounded-full bg-coin/20 text-ink-coin ring-1 ring-coin/55 ring-inset`, title,
109
+ a muted line, what you get as a check list in `border-t border-line pt-4`, a large gold key (or the feature's
110
+ short video).
111
+ - **A list cut off**: the newest N rows, then a card 「ほかにN件」 with a lock in `text-accent` and a small outline
112
+ "unlock" key.
113
+ - **Inline lock**: `inline-flex items-center gap-1 text-xs font-bold text-ink-coin` with a 14 px lock, beside the
114
+ thing.
115
+ - **Locked switch**: the whole row is a button that opens the offer; the switch drawn dimmed (`bg-surface-3
116
+ opacity-60`) and an amber line 「プレミアムのご利用中に使えます。」.
117
+ - Locked by a team admin, not by money: `text-xs font-bold text-ink-bronze` + lock, the fieldset `opacity-60`.
118
+ - Keep the free product useful: lock the extra, never the core; the lock line and the price stay on screen (not in
119
+ an InfoTip).
120
+
121
+ ## 7. Plan and billing
122
+
123
+ - **Status card**: `<Card tone="coin">` when subscribed: an eyebrow, the plan name `text-2xl font-bold` with a 28 px
124
+ crown, badges (trial, renews, cancelled); facts as a `<dl>` `grid divide-y divide-line overflow-hidden
125
+ rounded-control bg-surface-2/40 ring-1 ring-line sm:auto-cols-fr sm:grid-flow-col sm:divide-x sm:divide-y-0`;
126
+ alerts amber or coral; the "payment method / cancel" action under a `border-t pt-4`. Grid of cards `grid
127
+ items-start gap-4 xl:grid-cols-2`.
128
+ - **Offer card**: the black-and-gold plan card of `sections.md` §6 (dark in both themes, `.g6-sweep` wrapper,
129
+ prices from the catalogue, the yearly saving computed). The same component serves the homepage and the billing tab.
130
+
131
+ ## 8. The publish dialog (a moment to celebrate a save)
132
+
133
+ After a save that goes live worldwide, a gold-foil dialog says so once, with a still picture of the page reaching
134
+ the world. It is the one place with its own fixed colours (a printed-foil look the tokens do not carry):
135
+
136
+ - Native `<dialog>`, mounted closed while the editor is open, `showModal()` in a layout effect (before paint); Esc
137
+ → `preventDefault` + close; a click on the backdrop (`e.target === e.currentTarget`) closes.
138
+ - `.dialog { padding: 3px; width: min(600px, calc(100% - 16px)); max-height: 94dvh; overflow: auto; background:
139
+ linear-gradient(125deg, #9b6220, #ffe6a0 19%, #ab7834 46%, #ffeca8 74%, #9a692c); border: 1px solid #8d622d;
140
+ border-radius: 21px; box-shadow: 0 18px 65px #21130466 }`, `::backdrop { background: #251f1980 }` (no blur).
141
+ - Inner frame: `border: 1px solid #91672c; border-radius: 17px; padding: 0 16px 13px; background:
142
+ linear-gradient(145deg, var(--ivory), var(--shade)); box-shadow: inset 0 0 0 3px var(--ivory), inset 0 0 0 4px
143
+ var(--fine)` (a double rule). Variables light / dark: ivory `#fff5df` / `#302820`, shade `#efddb7` / `#211c18`,
144
+ fine `#c8a468` / `#795f3c`, ink `#392a20` / `#f8ebce`, muted `#6b5c4b` / `#ccbfa8`, gold `#805f20` / `#e5c57e`
145
+ (dark from `prefers-color-scheme` unless `data-theme="light"`, or `[data-theme='dark']` on `<html>`).
146
+ - Band: the logo (32 px), a title in tracked serif (`500 clamp(19px, 5vw, 26px) Georgia, serif; letter-spacing:
147
+ .13em`) between two hairline dashes (`width: 7%`), a round 40 px close button.
148
+ - The picture: an inline SVG world of gold dots on warm black (`radial-gradient(ellipse at 48% 34%, #463725, #231e19
149
+ 58%, #110f0d)`, `border: 3px double #d7ad5d; border-radius: 17px 5px`), the home city glowing, curves to cities on
150
+ every continent, computed once; 「図はイメージです」 under it. Stats as a `<dl>` of 4 columns (2 below 680 px, where
151
+ the dialog also sits at the bottom: `margin: auto auto 8px`).
152
+ - Steps: 0–5 s 「保存しました。世界各地へ配信中…」 beside a globe; at 5 s a gold check, 「世界中で公開されました」 and
153
+ the public URL; the heading `aria-live`. **No animation, no blur, no filters** (the owner found the animated
154
+ version too heavy). A 「次回から表示しない」 checkbox (localStorage) turns later saves into a dotted-underline line
155
+ in the save bar that reopens it.
156
+
157
+ ## 9. Chat (an AI helper, a chat-style wizard)
158
+
159
+ - Log `role="log" aria-live="polite"`. AI bubble after a 32 px logo mark: `g6-card min-w-0
160
+ max-w-[min(36rem,calc(100%-2.75rem))] rounded-2xl rounded-tl-md px-4 py-3 text-[15px] leading-relaxed`. User bubble
161
+ `tone-gold` in `flex justify-end pl-10`: `rounded-2xl rounded-tr-md bg-tone/15 px-4 py-3 ring-1 ring-tone/50
162
+ ring-inset whitespace-pre-wrap`; in a wizard the user's answers are buttons that reopen the answer for editing
163
+ (`hover:-translate-y-px`, the one being edited `shadow-glow ring-2 ring-gold`).
164
+ - Entrance `animate-rise [animation-duration:.45s]`; typing: three dots `size-2 animate-bounce rounded-full
165
+ bg-ink-gold/70` delayed 0 / 160 / 320 ms, shown 400–700 ms before each scripted line (skipped with reduced motion);
166
+ streamed AI text through a typewriter ticking every 33 ms; while working, a gold spinner and a stage label.
167
+ - Auto-scroll that follows the newest message must subtract the 18 px `animate-rise` offset when measuring.
168
+ - Suggestions: starter chips under the greeting (`pl-[2.625rem]`, `inline-flex min-h-9 max-w-full items-center
169
+ rounded-full bg-surface px-3 py-1.5 text-left text-sm font-bold text-ink-soft ring-1 ring-line-strong ring-inset
170
+ hover:text-ink-title hover:ring-gold/70`); choice cards `grid gap-2 sm:grid-cols-2`
171
+ (picked `bg-gold/15 shadow-glow-sm ring-gold/70`, plus a dashed 「その他」 card); quick replies `inline-flex h-9
172
+ rounded-full px-3 text-sm font-bold ring-1` (the suggested one champagne).
173
+ - Message box: a textarea `max-h-[32dvh] min-h-[4.25rem] resize-none` and a square send key (`w-12 px-0`).
174
+ **Enter makes a new line, Ctrl / ⌘ + Enter sends**: the Enter that confirms Japanese (IME) input must never send.
175
+ - A monthly allowance meter in the composer: `h-1.5 w-14` bar, champagne, amber from 80 %.
176
+
177
+ ## 10. Photos, card scan and a form the app fills
178
+
179
+ - Hidden `<input type="file">`, its value cleared after each pick (the same file can be picked again). Avatar: a crop
180
+ sheet with a round mask (`shadow-[0_0_0_999px_rgba(15,23,42,0.55)]` around a circle), pointer capture with
181
+ `touch-none`, a zoom range. Cover `aspect-[1200/630] rounded-card bg-surface-2 ring-1 ring-line`.
182
+ - Adding cards: a sheet with two `xl` keys side by side from `sm` (camera, files); a camera view `fixed inset-0 z-[70]
183
+ bg-black` with safe-area padding; an upload queue with a live count, a progress bar (`h-1.5 bg-gold
184
+ transition-[width] duration-300`) and rows with a spinner, done, failed or retry.
185
+ - **A form filled by the app** (OCR, autofill): while waiting, a `.scan-down` line (`h-0.5 bg-gold shadow-glow`) runs
186
+ over the photo and a status line moves on every ~1.8 s (stopping on its last step) so a few seconds never look
187
+ stuck; then the fields fill one after the other, top to bottom (~260 ms apart), each with `.fill-in` (`motion.md`
188
+ §5) and a new React `key` so the animation restarts; never overwrite what the user typed; an unsure reading shows
189
+ `bg-warning/8 ring-1 ring-warning/30` with confirm and fix actions. Around it: scale the photo in the browser to
190
+ ≤ 1600 px and send JPEG; poll a bounded number of times (e.g. 6 long polls of ~9 s); drop an answer that belongs to
191
+ an older photo; a photo that cannot be read stays attached and the user types.
192
+
193
+ ## 11. Small things that recur
194
+
195
+ - Progress (profile completeness): track `h-2 rounded-full bg-surface-3 ring-1 ring-line ring-inset`, fill
196
+ `bg-[linear-gradient(90deg,var(--c-gold-ink),var(--c-champagne-ink))] shadow-glow-sm transition-[width] duration-500
197
+ ease-glide`, `role="progressbar"`.
198
+ - Wallet buttons: use Apple's and Google's official badges unmodified (`block h-12 w-auto`), and give the Apple key
199
+ the same width as Google's badge through a variable (`--google-w: calc(3rem * 201 / 55)`).
200
+ - Confirm before deleting: an inline confirm that replaces the actions (`space-y-2.5 rounded-control bg-surface-2 p-3
201
+ ring-1 ring-line ring-inset`: the question, a `danger` key, a ghost 「キャンセル」 with `autoFocus`, focus back to
202
+ the original buttons afterwards). Prefer it to `window.confirm` and to a second sheet on top of a sheet.
203
+ - Article editor: `@container` with `@3xl:grid-cols-[minmax(0,1fr)_19rem]`, the side panel `@3xl:sticky
204
+ @3xl:top-20`; a keycap toolbar `sticky top-14 z-10` with buttons `shadow-[0_2px_0_var(--c-keycap-depth)]
205
+ active:translate-y-0.5`; checks drawn as ○ good, △ ok, × bad.
206
+
207
+ ## 12. Team console
208
+
209
+ - Shell like §1: `mx-auto max-w-7xl px-4 pt-6 pb-28 lg:pt-8`, `lg:grid lg:grid-cols-[15rem_minmax(0,1fr)] lg:gap-10`,
210
+ content `min-w-0 space-y-6`; a member without admin rights gets one `max-w-3xl` column and no menu. Sections from
211
+ `?section=`. PC: the same sidebar as §1 (lit bar on the active item); phones: a native `<Select>` of the sections
212
+ (`lg:hidden`), which is fast and needs no menu code. Section tones: insights champagne, members bronze, templates
213
+ and print rose, billing coin.
214
+ - Header: the team's logo `size-12 rounded-xl bg-white object-contain p-1 ring-1 ring-line` (or a bronze building
215
+ icon tile), an eyebrow `text-xs font-bold tracking-wider text-muted`, the name `truncate text-xl sm:text-2xl`, state
216
+ badges (pending warning, active success, inactive danger; owner coin).
217
+ - Section header `flex flex-wrap items-start justify-between gap-x-4 gap-y-3`: title `text-xl font-bold` + InfoTip,
218
+ actions wrapping under it on phones. A control someone may not use shows why in a `text-xs text-muted` line under
219
+ it (a gate note) instead of vanishing.
220
+ - Notices `rounded-card px-4 py-3 ring-1 ring-inset` + a tone (`bg-gold/10 ring-gold/50`, amber, coral `bg-coral/10
221
+ ring-coral/45`, champagne); amber and coral with `role="alert"`.
222
+ - **KPI tiles**: `grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`, each a card with a toned icon and a `text-sm
223
+ font-bold text-muted` label, the value `mt-2 text-2xl font-bold text-ink-title sm:text-3xl`, and a change line
224
+ with an arrow AND words (`text-success` / `text-danger` + "vs the previous 30 days"): colour is never the only cue.
225
+ - Members: a seat meter (`h-2 rounded-full bg-surface-2 ring-1 ring-line`, fill `bg-gold`, `bg-amber` when full);
226
+ role badges (owner coin, manager bronze, may see all cards accent, you success, expired invitation warning); an
227
+ invite form `flex flex-col sm:flex-row` with the submit `sm:min-w-40`, a success line `role="status"`, and, when
228
+ the seats are full, a link to billing in the message; the list a `Card padding="none"` with `divide-y divide-line`;
229
+ permissions as switches in `rounded-control bg-surface-2 p-3 ring-1 ring-line`.
230
+ - Rows of physical items (NFC cards): `flex min-h-16 w-full items-center gap-3 rounded-card bg-surface px-3 py-2.5
231
+ ring-1 ring-line focus-visible:ring-4 focus-visible:ring-champagne/40`, the item's picture with
232
+ `drop-shadow-[0_4px_8px_rgb(40_28_8/.22)]` (inactive `opacity-50 grayscale`); filter chips with counts; list
233
+ `grid grid-cols-1 gap-2 xl:grid-cols-2`. An order sheet: `size-12` quantity keys, the chosen line `bg-gold/10
234
+ ring-gold/60`, the total `text-2xl font-bold` + 税込.
235
+ - Template editors (what members' pages inherit): §2's layout with a `320px` preview; mode cards selected `bg-gold/10
236
+ ring-2 ring-gold/70`, locked-for-members `bg-coin/12 ring-2 ring-coin/70` + a lock; the save bar here is a card
237
+ that sticks inside the column: `sticky bottom-3 z-10` → `Card shadow-float` with dirty / saved (gold check) / error
238
+ messages. A three-pane editor: `lg:grid-cols-[10.5rem_minmax(0,1fr)_18rem]`, side panes `lg:sticky lg:top-20`,
239
+ reordered with `order-*` on phones; tabs underlined with `shadow-[inset_0_-2px_0_var(--color-gold)]`.
240
+
241
+ ## 13. Charts
242
+
243
+ No chart library: columns, meters and segmented bars from divs and small SVG, which keeps them themeable, accessible
244
+ and light.
245
+
246
+ - **Data colours are not gold.** Gold means "action / selected" in this style, so data uses a separate palette set
247
+ per section as CSS variables, light / dark: views `#2a78d6` / `#3987e5` (mid `#86b6ef` / `#1c5cab`, soft `#cde2fb` /
248
+ `#0d366b`), a second series `#eb6834` / `#d95926`, a third `#1baf7a` / `#199e70`, other `#a89a80` / `#6f634d`.
249
+ Switch them with `prefers-color-scheme`, overridden by `data-theme` (the same rules as the tokens). Validate a new
250
+ palette for contrast in both themes (skill `dataviz` if the project has it).
251
+ - Daily columns: a 136 px plot, bars `w-full max-w-6 rounded-t-[4px]` (1 px gaps and `rounded-t-[1px]` above 31
252
+ days), gridlines `border-t border-line`, baseline `border-line-strong`; the day under the pointer `bg-surface-2`, the
253
+ others at opacity .55; the plot is ONE tab stop moved with arrows, Home and End; a readout in the `figcaption`
254
+ (`aria-live`); a 「表で見る」 `<details>` with the same data as a table (`max-h-96 overflow-auto`, `sticky top-0`
255
+ header).
256
+ - Meter list: `grid-cols-[minmax(0,1fr)_auto] sm:grid-cols-[9rem_minmax(0,1fr)_auto]`, tracks `h-2 rounded-full` in
257
+ the soft data colour. Segmented bar: `flex h-2 gap-0.5`, `flex-grow` per part, a swatch `<dl>` legend.
258
+ - States: loading `h-72 animate-pulse rounded-card bg-surface-2`; while a new range loads the old figures stay,
259
+ `opacity-60 transition-opacity duration-200` + `aria-busy`; a new team with no data gets a champagne card that says
260
+ what will appear; empty a `text-sm text-muted` line. Ranges are chips.
261
+
262
+ ## 14. Tables, cards, search, pages
263
+
264
+ - **A table from `md`, cards on phones**: table `hidden overflow-hidden rounded-card bg-surface ring-1 ring-line md:block
265
+ table-fixed`; sortable headers are `<button>`s in `th` with `aria-sort` (`border-b border-line bg-surface-2 px-3
266
+ py-2`); long text `truncate` with the full value in `title`; columns that can wait `hidden xl:table-cell`. Phones:
267
+ a `<Select>` for the sort + cards, each with a `dl grid grid-cols-2 min-[360px]:grid-cols-3` of mini stats
268
+ (`rounded-control bg-surface-2 px-1 py-2`, a `text-2xs` label over a `text-lg` value). A user may switch table /
269
+ cards themselves (a segmented control, remembered in localStorage, default from `matchMedia('(min-width: 768px)')`).
270
+ - A sticky table header (`sticky top-14 z-10 bg-surface-2`) needs its frame clipped with `[overflow:clip]`, not
271
+ `overflow-hidden` (which makes a scroll container and breaks sticky). Rows that open a detail: `cursor-pointer
272
+ hover:bg-ink-title/[.035]`, the detail in the wide sheet.
273
+ - The global `table { min-width: 520px }` applies everywhere: give a small table `min-w-0` or its own minimum.
274
+ - Bulk actions: a bar `rounded-card bg-surface p-3 shadow-sm ring-1 ring-accent/40` when rows are selected.
275
+ - Search field: `rounded-control bg-surface px-3 ring-1 ring-line focus-within:ring-2 focus-within:ring-champagne/60`
276
+ around an `h-11 bg-transparent outline-none` input and a search button. Debounce by cost: a list filtered locally
277
+ 300 ms; a search that hits a paid or heavy backend 1.5 s, while Enter, the button and an emptied box search at once.
278
+ Filters `md:grid-cols-[minmax(0,1fr)_16rem]`, then `grid-cols-2 md:grid-cols-4` selects at `h-11`.
279
+ - Pager: pages of 20, 「全N件中 21–40件」 and 「2 / 7」, outline keys `min-h-11`, a spinner while loading, back to the
280
+ top of the list on change.
281
+
282
+ ## 15. Shop and cart
283
+
284
+ - Page `max-w-5xl`; perks as badges; a closed shop says so in an amber box (`tone-amber rounded-card bg-tone/12 p-4
285
+ ring-1 ring-tone/40 ring-inset`) and still shows the products.
286
+ - **The cart is the page**: no drawer. The product grid `grid max-w-md gap-5 md:max-w-none md:grid-cols-2`, then a
287
+ summary card. Each item spans 5 rows of a subgrid (`md:row-span-5 md:grid md:grid-rows-subgrid` on both the `li`
288
+ and the card), so pictures, names, prices and keys line up across cards whatever the text length.
289
+ - Product card: `.g6-card .g6-glow .tone-coin flex h-full flex-col overflow-hidden`; in the order it gets
290
+ `outline-2 outline-gold/70`. Picture `h-56 sm:h-64` on `bg-[radial-gradient(80%_70%_at_50%_42%,rgb(242_199_110/.26),transparent_72%)]`,
291
+ the product tilted with `drop-shadow-[0_18px_22px_rgb(40_28_8/.28)]`, a count badge in the top right once added.
292
+ Price `font-display text-[2.75rem] leading-[1.15] font-bold tracking-tight tabular-nums` + 「税込・送料無料」
293
+ `text-sm text-muted`; discounted: the list price struck through above it and a warning 「N%OFF」 badge.
294
+ - What comes with it (bonus months of the plan): `tone-coin flex items-start gap-2 rounded-2xl bg-tone/12 p-3 text-sm
295
+ font-bold text-tone-ink ring-1 ring-tone/40 ring-inset` with a gift icon and an InfoTip holding the rules and a
296
+ worked example.
297
+ - Quantity: round keys `size-11 rounded-full ring-1 ring-line-strong hover:ring-gold/70` around a typed field `h-11
298
+ w-16 text-center font-display text-xl`.
299
+ - Summary: a volume-discount note, a `<dl class="divide-y divide-line border-y">` (list price struck, −volume discount,
300
+ −code, the total `font-display text-3xl`), a gold hint 「あとN枚でX%OFF」, an amber alert over the limit, a
301
+ champagne box where shipping is limited (non-Japanese pages: "ships to Japan only"). Code field: an `uppercase
302
+ font-mono` input + an outline 「適用」; once applied a coin pill (`rounded-full bg-tone/12 ring-1 ring-tone/45`) with a
303
+ remove button. A code shown under a price is `font-mono select-all`. Discounts are computed by the server and
304
+ carried to the payment page; the page only shows them.
305
+ - Order result: success a gold-face medallion with `animate-pop-in`; waiting `size-12 animate-spin rounded-full
306
+ border-4 border-gold border-t-transparent`; error a coral circle with what to do next.
307
+
308
+ ## 16. A public page in the user's colours (a profile)
309
+
310
+ - Frame `min-h-dvh sm:py-8` → `relative mx-auto flex min-h-dvh max-w-[440px] flex-col bg-surface-base sm:min-h-0
311
+ sm:overflow-hidden sm:rounded-[2rem] sm:border sm:border-line sm:shadow-float`: a phone-width column that floats on
312
+ the theme's background on a PC. System fonts only (`tokens.md` §6), a strict JS budget, the cover painted before
313
+ the JS (the server writes its `<img>` into the shell).
314
+ - Header variants: a cover photo `aspect-[1200/630]` with the avatar `size-[131px] -mt-[66px] ring-4 ring-surface`; a
315
+ band in the brand colour (`h-32`); a 6 px brand top border with the avatar `ring-2 ring-(--brand) ring-offset-4`; a
316
+ clean header with a `h-[3px] w-10` brand bar. Avatar position (floating / inside × left / centre / right) by
317
+ `data-avatar` attributes in plain CSS, no JS.
318
+ - The user's brand colour leads (`tokens.md` §7, `.profile-brand`); themes re-theme the card like a `data-theme`
319
+ subtree: a pinned scheme, `--c-*` overrides on the root, background art, an icon set, `--card-accent` for the save
320
+ key (the `accent` button).
321
+ - Body blocks `.g6-card p-4`; links are link rows (`flex flex-col gap-2.5`) whose hover ring and glow take the brand
322
+ colour; other services' logos as their own marks.
323
+ - Actions: a full-width primary key 「連絡先に保存」 + a square share key `size-12` with the keycap depth; the share
324
+ sheet holds the QR (`size-48 rounded-xl bg-white p-2`), the URL and a copy key; iOS gets numbered steps where its
325
+ share flow differs.
326
+ - A visitor sending something back (their own card): choice rows `rounded-2xl bg-surface p-4 ring-1 ring-line
327
+ hover:ring-2 hover:ring-coin/60`, a sent state with a `size-14 rounded-full bg-primary/15` mark.
328
+
329
+ ## 17. Manual and long help pages
330
+
331
+ - `max-w-6xl lg:grid lg:grid-cols-[15.5rem_minmax(0,1fr)] lg:gap-12`; a contents sidebar `sticky top-14
332
+ max-h-[calc(100dvh-3.5rem)] overflow-y-auto`, the active entry `border-l-2 border-ink-gold bg-surface-2`; phones: a
333
+ bar `sticky top-14 z-20 bg-surface-base/90 backdrop-blur-xl` that opens the contents in a sheet.
334
+ - Article `max-w-[70ch]`, body `text-[0.97rem] leading-[1.9]`; h2 `mt-14 border-t border-line pt-8`; notes
335
+ `border-l-4 border-l-ink-champagne` (amber for warnings); wide tables `overflow-x-auto rounded-card border` with
336
+ `min-w-[36rem]`; portrait screenshots `max-w-[18rem] rounded-[1.75rem]`. Index cards `.g6-card .g6-glow .tone-*
337
+ hover:-translate-y-0.5`. A small toast is allowed here (copied a link): `fixed bottom-6 z-50` pill with an opacity
338
+ transition.
339
+ - Print: everything in `@media print`, `@page { margin: 15mm 14mm 16mm }`, gold dropped on purpose (`#1a1a1a` on
340
+ white: a manual is read, not admired), each h2 on a new page, images `max-height: 110mm`, links print their address
341
+ (`attr(data-print-url)`), screen-only parts `print:hidden`.
342
+
343
+ ## 18. Admin
344
+
345
+ - **Always light** (`data-theme="light"` on its layout): a work tool, dense and plain. A dark slate sidebar `w-64
346
+ bg-[#1f2b37]` (`sticky top-0 max-h-dvh overflow-y-auto`; items `text-slate-300`, active `bg-white/10 font-bold
347
+ text-white`, group labels `text-[11px] uppercase text-slate-400`); phones: a drawer `fixed inset-0 z-40` with a
348
+ `bg-black/40` scrim and a `w-72 max-w-[85vw]` panel; header `sticky top-0 z-30 h-14 bg-surface/95 backdrop-blur`;
349
+ main `max-w-[1400px] px-3 lg:px-8`. Controls `h-9` / `h-10`, `text-sm`; plain `slate-*` is fine here.
350
+ - Filter tabs: `-mb-px border-b-2` underlines with a count pill (`bg-primary text-on-primary` when active). KPI tiles
351
+ `rounded-card border border-line bg-surface p-4 shadow-sm`, value `text-3xl font-bold tracking-tight`, grids `grid
352
+ gap-4 sm:grid-cols-2 xl:grid-cols-4`; hairline grids with `grid gap-px bg-line`.
353
+ - Wide tables (`min-w-[1040px]`) from `md`, cards on phones; or rows that stack: `block md:table`, each `td` `flex
354
+ justify-between` with its label beside the value.
355
+ - Status badges by kind: shipping pending warning, preparing / packed accent, shipped success, delivered neutral,
356
+ cancelled danger; payment succeeded success, pending / partly refunded warning, failed danger, refunded neutral;
357
+ late always danger; all `whitespace-nowrap`.
358
+ - Order detail `grid items-start gap-4 lg:grid-cols-[minmax(0,1fr)_22rem]`: status pills (current `bg-primary
359
+ text-on-primary`, done `bg-primary/10`), a confirm box before a state change, a timeline of 11 px dots joined by a
360
+ `w-px bg-line` rule, facts as `grid-cols-[7.5rem_minmax(0,1fr)]`.
361
+ - A phone admin for packing and shipping: a bottom nav `fixed bottom-0 z-30 grid h-16 grid-cols-4
362
+ pb-[env(safe-area-inset-bottom)]`, outcome panels `bg-success/10` / `bg-warning/10` / `bg-danger/10` with 56 px icons.
363
+
364
+ ## 19. Print: letters and cards
365
+
366
+ - A print root portalled as a direct child of `<body>`, every other child hidden in print (`body > *:not(.print-root)
367
+ { display: none }`), `@page { size: A4 portrait; margin: 0 }` (or `<w>mm <h>mm` for another sheet), pages `width:
368
+ 210mm; height: 296mm` (1 mm under the sheet: content that rounds past it adds a blank page), positions in mm and
369
+ type in pt. Print CSS unlayered with its own prefix, and `img { max-width: none }` (Tailwind's preflight caps
370
+ images at 100 %).
371
+ - **Keeping the gold**: backgrounds print only with `print-color-adjust: exact` (+ `-webkit-`); gold as fixed hex
372
+ (`#c49a45`, `#8a6211`, `#d8bd85`), never theme variables (print is always "light"). A card meant for a print shop is
373
+ drawn on a canvas at 300 dpi and exported as a PNG with a pHYs chunk (the dpi), so the printer gets pixels, not CSS;
374
+ crop marks 0.2 mm; a business card 91 × 55 mm, a sheet of 2 × 5 with 14 / 11 mm margins.
375
+ - Letters: several designs (washi, sumi, hakuji…) from one layout; another paper size is the A4 layout scaled with
376
+ `transform`; spare height shared by flexible gaps (`flex: 1 1 0; min-height: var(--gap)`).
377
+ - Fonts: a print font with `font-display: block`, and `await document.fonts.ready` (and the QR, up to 3 s) before
378
+ `window.print()`; a canvas loads its font files before drawing.
379
+ - On screen, a preview of the sheet: `aspect-[91/55] bg-white shadow-sm ring-1 ring-black/10`.
380
+
381
+ ## 20. Layers, offsets and other traps
382
+
383
+ | z | What |
384
+ |---|---|
385
+ | 10 | sticky toolbars, table headers (`top-14`, under the 56 px header), a sticky save card |
386
+ | 20 | chat composers, a help page's phone bar |
387
+ | 30 | the header, the admin header, a phone admin's bottom nav, small dropdowns |
388
+ | 40 | the phone menu, the save bar, the language popover, the admin drawer |
389
+ | 50 | sheets, a help page's toast |
390
+ | 60 | a preview overlay above a sheet, InfoTip popovers |
391
+ | 70 | the camera |
392
+ | top layer | native `<dialog>` (video, publish) |
393
+
394
+ - Sticky asides use `top-20`; anything that hard-codes the header height (`calc(100dvh - …)`) must change with it.
395
+ - Two stacked modals both listening for Esc on `window` close together: the upper one listens in the capture phase
396
+ and calls `stopPropagation` (and traps Tab when it is a full overlay).
397
+ - Scroll lock with `body.style.overflow` only (no iOS fix); a native `<dialog>` does not lock the page at all.
398
+ - Safe areas on everything fixed to the bottom (`pb-[max(0.75rem,env(safe-area-inset-bottom))]`) and on the camera's
399
+ top.
400
+ - Scaled previews: either `transform: scale` in a box of the scaled size, or CSS `zoom` for tiny thumbnails; never
401
+ both in one tree.
402
+ - The header slot is `null` on the first render: render a page's phone menu only once it exists.
403
+ - Pictures that are drawn on ivory (flat illustrations, phone screens) sit on a fixed light panel in both themes:
404
+ `data-theme="light" rounded-2xl bg-[#fbf6ea] ring-1 ring-line`.
@@ -17,6 +17,21 @@ Use the project's own checks where it has them; the audit below is for projects
17
17
  back mid-word and looks broken).
18
18
  - [ ] Network panel on load: no video bytes before a click; images WebP and sized for 2x.
19
19
  - [ ] Every QR on the page or in a picture opens a page that exists.
20
+ - [ ] App screens (signed in): each changed screen at 390 px and 1440 px, light and dark, with real-looking data AND
21
+ the empty, loading, error, locked (free account) and saving states; a long name, a long English / Vietnamese
22
+ label and a 30-character URL in the tightest spot.
23
+ - [ ] Sheets and popovers: Esc closes, focus moves in and comes back to the opener, the page behind does not scroll,
24
+ the InfoTip opens above a sheet and stays inside the viewport at 320 px (its placement function has unit
25
+ tests), every icon-only button has an `aria-label`, every target is at least 40–44 px.
26
+ - [ ] A page with a speed budget (a public page people open from a QR on 4G): its scripts stay within the budget
27
+ (gzip, measured from the build output, failing the build when over) and its largest paint is measured with
28
+ throttling (Slow 4G + 4x CPU, 375 px @ 2x and 393 px @ 3x, empty cache, p75 of ~8 runs ≤ 2 s). A shared
29
+ component imported by the not-found page or the root layout can drag a heavy library (framer-motion) into
30
+ every page: check after touching shared code.
31
+ - [ ] Print layouts (letters, cards, manuals): the browser's print preview at 100 %, A4, backgrounds on; text never
32
+ crosses the cut / safe lines; every QR in print reads back with a phone.
33
+ - [ ] Every page shows the language it was asked for (the mobile check opens each page per language) and nothing
34
+ sits between the header and the page on phones.
20
35
  - [ ] The project's own gate (lint, typecheck, build, tests, e2e) is green; screenshots of the result shown to the
21
36
  user.
22
37