@charset "UTF-8";
/* One brush face (OFL 1.1; source and licence in fonts/), cut down to the glyphs names use.
   It is fetched only by a page that shows a name in it, and text never waits for it. */
@font-face {
  font-family: "Ming Ma Shan Zheng";
  src: url("/assets/fonts/mashanzheng/MaShanZheng-names.962f71a3d041.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* 1. Tokens: paper, ink and one vermilion; six type sizes; two and a half radii; an 8px rhythm. */
:root {
  --paper: #f7f3eb;
  --card: #fffcf6;
  --ink: #292720;
  --muted: #463f37;
  --faint: #6b6257;
  --accent: #7d2c20;
  --accent-hover: #65251b;
  --accent-pressed: #502018;
  --danger: #b3261e;
  --danger-wash: #fbece9;
  --line: #d6cbbb;
  --control: #978775;
  --wash: #eee7db;
  --wash-hover: #e4d8c8;
  --wash-pressed: #d8c6b2;
  --disabled-wash: #e8e4dc;
  --disabled-ink: #625b51;
  --radius-paper: 2px;
  --radius-control: 6px;
  --radius-chip: 999px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 28px;
  --text-2xl: 40px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --content-width: 1160px;
  --reading-width: 580px;
  --auth-width: 408px;
  --page-gutter: 48px;
  --panel-padding: 32px;
  --layout-gap: 64px;
  --control-height: 48px;
  --page-title-size: var(--text-2xl);
  --section-title-size: var(--text-xl);
  --name-size: 88px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Noto Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  /* Songti on Apple systems, Noto/Source Han Serif on Android and Linux, SimSun on Windows. */
  --chinese: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", "Noto Serif SC", "SimSun", "NSimSun", serif;
  --brush: "Ming Ma Shan Zheng", var(--chinese);
  --display-font: var(--serif);
  --shadow: 0 8px 24px #45301808;
}
html[lang="zh-Hans"] { --display-font: var(--chinese); }
@media (max-width: 1000px) {
  :root { --page-gutter: 28px; --panel-padding: 24px; --layout-gap: 32px; --page-title-size: 36px; --name-size: 68px; }
}
@media (max-width: 640px) {
  :root { --page-gutter: 20px; --panel-padding: 20px; --page-title-size: var(--text-xl); --section-title-size: 24px; --name-size: clamp(52px, 17vw, 72px); }
}
@media (max-width: 360px) {
  :root { --page-gutter: 16px; --panel-padding: 16px; }
}

/* 2. Base elements. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--column-stick-top, 84px); }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; margin: 0; background: var(--paper) radial-gradient(#51402a09 .5px, transparent .5px) 0 0 / 5px 5px; color: var(--ink); font: 400 var(--text-md)/1.75 var(--sans); -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; min-width: 0; }
html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 5px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button, input, select { min-height: 48px; }
/* Landmarks receive focus for navigation. Only interactive controls draw a focus ring. */
:is(#main, #form-title, #register-password-title, dialog), :is(#main, #form-title, #register-password-title, dialog):is(:focus, :focus-visible) { outline: none; box-shadow: none; }
/* The ring is ink, not vermilion: a focused field is not the screen's one accent. */
:is(button, a, input, select, textarea, summary, [role="option"]):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--display-font); font-weight: 400; line-height: 1.25; text-wrap: balance; margin-bottom: var(--space-2); }
html[lang="zh-Hans"] :is(h1, h2) { line-height: 1.4; letter-spacing: .06em; }
h1 { font-size: var(--page-title-size); }
h2 { font-size: var(--section-title-size); }
h3 { font: 600 var(--text-md)/1.5 var(--sans); margin-bottom: var(--space-1); }
p { margin-bottom: var(--space-2); }
.wrap, .masthead-inner { width: min(var(--content-width), calc(100% - var(--page-gutter) * 2)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; background: var(--card); padding: 12px; }
.skip-link:focus { top: 60px; }
.noscript-note { position: fixed; bottom: 0; width: 100%; padding: var(--space-2) var(--space-3); background: var(--wash); border-top: 1px solid var(--control); }
.eyebrow { color: var(--faint); font-size: var(--text-xs); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; margin-bottom: var(--space-2); }
.quiet, .fine-print, .field-help { color: var(--faint); font: 400 var(--text-xs)/1.75 var(--sans); }
.quiet { font-size: var(--text-sm); }

/* 3. The header: the brand, the two sections, and the tools (language, account). The footer is a row of policy links. */
.demo-strip { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; gap: 0 var(--space-3); min-height: 68px; }
/* Equal side columns centre the sections until the brand or tools need more room. */
.header-signature { display: flex; flex: 1 1 0; align-items: baseline; gap: var(--space-2); }
.wordmark { flex: none; color: var(--ink); line-height: 1; text-decoration: none; }
.brand-name { font: 500 36px/1 var(--serif); letter-spacing: -.055em; }
/* The mark sits like a period at the end of Mingli, without becoming the baseline. */
.brand-name::after { content: ""; display: inline-block; width: .115em; height: .115em; margin-inline-start: .12em; vertical-align: .08em; background: var(--accent); transform: rotate(45deg); }
.brand-motto { color: var(--faint); font: 400 var(--text-sm)/1.2 var(--display-font); white-space: nowrap; }
.site-nav { display: flex; flex: none; align-self: stretch; gap: var(--space-1); }
.site-nav a { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 72px; min-height: 68px; padding-inline: var(--space-2); color: var(--muted); font: 400 19px/1 var(--display-font); text-decoration: none; white-space: nowrap; }
html[lang="zh-Hans"] .site-nav a { letter-spacing: .14em; text-indent: .14em; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current]::after { content: ""; position: absolute; inset-inline: var(--space-2); bottom: -1px; border-top: 2px solid var(--ink); }
.site-nav a:focus-visible { outline-offset: -4px; }
.site-tools { display: flex; flex: 1 1 0; align-items: center; justify-content: flex-end; gap: var(--space-1); }
.account-link { display: inline-flex; flex: none; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.account-link > span { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 1px solid var(--control); border-radius: var(--radius-control); font: 500 13px/1 var(--sans); white-space: nowrap; }
.account-link svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.account-link:hover > span { background: var(--wash); }
.account-link[aria-current] > span { border-color: var(--ink); background: var(--wash); }
.language-switch { display: inline-flex; align-items: center; flex: none; }
/* The reviewed legal pages keep their earlier markup, a trigger over two options. They are
   never edited or rewritten by script: here the trigger is hidden and the options stand as the pair. */
.language-toggle { display: none; }
.language-options { display: contents; }
.language-switch [data-language] { position: relative; min-width: 44px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--faint); font-size: var(--text-xs); letter-spacing: .04em; }
.language-switch [data-language]:hover, .language-switch [aria-pressed="true"] { color: var(--ink); }
.language-switch [aria-pressed="true"] { font-weight: 600; }
.language-switch [data-language] + [data-language]::before { content: "/"; position: absolute; inset-inline-start: -3px; color: var(--control); font-weight: 400; }
.language-options [data-language] { padding-inline: 8px; }
.site-footer { display: flex; justify-content: center; padding-block: var(--space-1); }
.legal-links { display: flex; flex-wrap: wrap; gap: var(--space-3); color: var(--faint); font-size: var(--text-xs); }
.legal-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.legal-links a:hover { color: var(--ink); text-decoration: underline; }

/* 4. Controls. One vermilion button per screen (.primary); everything else is ink on paper. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-height: var(--control-height); padding: 11px 20px; border: 1px solid transparent; border-radius: var(--radius-control); font: 500 var(--text-sm)/1.5 var(--sans); text-align: center; text-decoration: none; text-wrap: balance; max-width: 100%; }
.primary { color: var(--card); background: var(--accent); }
.primary:not(:disabled):hover { background: var(--accent-hover); }
.primary:not(:disabled):active { background: var(--accent-pressed); }
.secondary { color: var(--ink); background: var(--wash); }
.secondary:not(:disabled):hover, .outline:not(:disabled):hover { background: var(--wash-hover); }
.secondary:not(:disabled):active, .outline:not(:disabled):active { background: var(--wash-pressed); }
.outline { color: var(--ink); background: transparent; border-color: var(--control); }
button:disabled { cursor: not-allowed; color: var(--disabled-ink); background: var(--disabled-wash); border-color: transparent; }
button[aria-busy="true"] { cursor: progress; }
.full-width { width: 100%; }
.button-row { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-2); }
.button-row.start { justify-content: flex-start; }
.text-row { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); }
/* A text button is text: no face, no capsule. Its 44px height is the touch target. */
.text-button, .text-link { color: var(--ink); font: 500 var(--text-sm)/1.5 var(--sans); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; text-align: start; }
.text-link { display: inline-block; padding-block: 11px; }
.text-button:hover, .text-link:hover { color: var(--accent); }
button.text-button:disabled { background: none; text-decoration: none; }
.danger-action, .danger-action:hover { color: var(--danger); }
.primary.danger-action { color: var(--card); background: var(--danger); }
.primary.danger-action:not(:disabled):hover { background: var(--accent-pressed); }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: var(--radius-control); background: none; color: var(--ink); font-size: 25px; line-height: 1; }
.icon-button:hover { background: var(--wash); }
/* Every text control is one family: the same border, radius, paper and 16px type. */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select, textarea { display: block; width: 100%; min-width: 0; min-height: var(--control-height); padding: 11px 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--card); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input[readonly], select:disabled, input:disabled { color: var(--muted); background: var(--wash); border-color: var(--line); cursor: not-allowed; }
:is(input, select, textarea)[aria-invalid="true"] { border-color: var(--danger); }
textarea { min-height: 96px; resize: vertical; }
/* Give the native select the same text box and a quiet arrow. */
select { appearance: none; padding-right: 36px; text-overflow: ellipsis; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--card); color: var(--ink); }
fieldset { min-width: 0; margin: 0 0 var(--space-3); padding: 0; border: 0; }
legend { padding: 0; margin-bottom: var(--space-1); font-size: var(--text-md); font-weight: 600; line-height: 1.5; }
.field { min-width: 0; margin-bottom: var(--space-3); }
.field label, .wish-field label { display: block; margin-bottom: var(--space-1); font-size: var(--text-sm); font-weight: 500; line-height: 1.5; }
.field-help { margin-block: var(--space-1) var(--space-2); }
.field > .field-help, .field > .legal-notice { margin-bottom: 0; }
/* Feedback beside the control it is about. Only a failure is red; notes and successes are ink. */
.field-error { margin: var(--space-1) 0 0; color: var(--danger); font-size: var(--text-sm); line-height: 1.6; }
.error-box, .notice-box { margin-block: var(--space-2); padding: 12px var(--space-2); border-inline-start: 2px solid var(--ink); background: var(--wash); font-size: var(--text-sm); overflow-wrap: anywhere; }
.error-box { color: var(--danger); border-color: var(--danger); background: var(--danger-wash); }
/* CR-20261129: the consent notice beside an email field and its submit button.
   Small, but never faint, folded or hidden: body ink on paper, both links
   underlined and tall enough to tap. There is no checkbox. */
.legal-notice { margin-block: var(--space-1) 12px; color: var(--muted); font: 400 13px/1.7 var(--sans); overflow-wrap: anywhere; }
.legal-notice a { padding-block: 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.legal-notice a:hover { color: var(--accent); }
.legal-notice-row { margin-block: 12px 4px; }
.legal-reack { display: grid; gap: var(--space-1); justify-items: start; margin-block: 12px var(--space-2); padding: 12px var(--space-2); border-inline-start: 2px solid var(--ink); background: var(--wash); }
.legal-reack > .legal-notice { margin: 0; }
.legal-reack > h2 { margin: 0; font-size: var(--text-lg); }
.legal-reack .outline { background: var(--card); }
/* Options that toggle are the only pills; an option with two lines of text is a small card. */
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice > span { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 48px; padding: 10px 12px; border-radius: var(--radius-chip); background: var(--wash); color: var(--ink); font-size: var(--text-sm); line-height: 1.5; }
.choice input:enabled:hover + span { background: var(--wash-hover); }
.choice input:checked + span, .choice input:checked:hover + span { background: var(--ink); color: var(--card); font-weight: 600; }
.choice input:enabled:active + span { background: var(--wash-pressed); color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.choice input[aria-invalid="true"] + span { box-shadow: inset 0 0 0 2px var(--danger); }
.choice input:disabled + span { color: var(--disabled-ink); background: var(--disabled-wash); }
.choice input:disabled { cursor: not-allowed; }
.choice-row { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.choice-row .choice > span { padding-inline: var(--space-3); }
.check-option { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding-block: 10px; font-size: var(--text-sm); line-height: 1.6; cursor: pointer; }
.check-option input { flex: none; width: 20px; height: 20px; min-height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.check-option small { display: block; margin-top: 4px; color: var(--faint); font-size: var(--text-xs); }

/* 5. Shared pieces: dialogs, the toast, the loading mark, status pages, empty states. */
dialog { width: min(var(--reading-width), calc(100% - var(--page-gutter) * 2)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: var(--panel-padding); border: 0; border-radius: var(--radius-paper); background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: #29272099; }
dialog h2 { font-size: var(--text-xl); }
dialog > p { color: var(--muted); font-size: var(--text-sm); }
.dialog-header { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-1); margin-bottom: var(--space-3); background: var(--paper); }
.dialog-header > h2 { margin: 0; }
.confirm-dialog { width: min(480px, calc(100% - 32px)); }
.confirm-dialog h2 { font-size: var(--text-lg); overflow-wrap: anywhere; }
.confirm-dialog > p { overflow-wrap: anywhere; }
.confirm-actions { justify-content: flex-end; margin-top: var(--space-3); }
.confirm-actions .button { white-space: normal; }
.toast { position: fixed; left: 50%; bottom: var(--space-4); z-index: 60; max-width: calc(100% - 32px); padding: 10px var(--space-3); border-radius: var(--radius-control); background: var(--ink); color: var(--card); font-size: var(--text-sm); text-align: center; opacity: 0; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast[data-shown] { opacity: 1; transform: translate(-50%, 0); }
/* The brand diamond, breathing: the one loading sign on every page. */
.loading-mark { display: inline-block; width: 12px; height: 12px; margin: var(--space-2); background: var(--accent); transform: rotate(45deg); animation: breathe 1.6s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: .25; } to { opacity: 1; } }
.loading-block { display: grid; justify-items: center; gap: var(--space-1); padding-block: var(--space-6); color: var(--faint); text-align: center; }
main:has(.status-view:not([hidden])) { display: grid; align-content: center; }
.status-view { display: grid; justify-items: center; max-width: 640px; padding-block: var(--space-6); text-align: center; }
.status-view .text-link + .text-link { margin-inline-start: var(--space-3); }
.empty-state { color: var(--faint); font-size: var(--text-sm); }
.empty-state .text-link { margin-inline-start: var(--space-1); }
details.rules { margin-top: var(--space-1); color: var(--faint); font-size: var(--text-sm); }
details.rules summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
/* Give the deferred translator a first paint; show the original text if loading stalls. */
@media (scripting: enabled) {
  html:not([data-language-ready]):has(.language-switch) > body { animation: ming-first-language .4s step-end; }
  @keyframes ming-first-language { from { opacity: 0; } to { opacity: 1; } }
}

/* 6. Home: one name in the middle of the page. Background names drift by in pale ink. */
#home-view { position: relative; }
.hero-scene { position: relative; isolation: isolate; overflow: clip; min-height: min(700px, calc(100svh - 120px)); padding: clamp(24px, 6vh, 64px) 0 var(--space-8); }
/* Never shorter than 520px, so rows of one lane stay a full name plus both drifts apart; the scene clips the rest. */
.name-field { position: absolute; inset: 0; z-index: -1; min-height: 520px; pointer-events: none; user-select: none; }
/* Ten fixed slots in three lanes on each side of the column; script only nudges them. */
.field-name { position: absolute; top: var(--y, 10%); writing-mode: vertical-rl; color: #292720; font-family: var(--brush); font-size: var(--size, 32px); font-style: normal; font-weight: 400; font-synthesis: none; line-height: 1.25; letter-spacing: .08em; white-space: nowrap; opacity: 0; }
.field-name:nth-child(odd) { left: clamp(12px, calc((50% - 300px) * var(--x, .1)), calc(50% - 356px)); }
.field-name:nth-child(even) { right: clamp(12px, calc((50% - 300px) * var(--x, .1)), calc(50% - 356px)); }
/* Below 1140px the bands hold two lanes, not three: the middle-lane pair is not drawn. */
@media (max-width: 1139px) { .field-name:nth-child(5), .field-name:nth-child(6) { display: none; } }
/* A slow rise of --rise (60-96px) with a slight --sway either way; each name fades in, holds, fades out. */
.name-field[data-ready] .field-name { animation: name-drift var(--duration, 9.5s) ease-in-out var(--delay, 0s) infinite; }
@keyframes name-drift {
  0% { opacity: 0; transform: translate(calc(var(--sway, 10px) * -1), calc(var(--rise, 76px) / 2)); }
  22%, 70% { opacity: var(--peak, .24); }
  100% { opacity: 0; transform: translate(var(--sway, 10px), calc(var(--rise, 76px) / -2)); }
}
/* Later and at least as specific as the animation shorthand above, which would otherwise set them running again. */
.hero-scene:is([data-motion="reduced"], [data-suspended="true"]) .field-name, body:has(dialog[open]) .name-field .field-name { animation-play-state: paused; }
.hero-foreground { position: relative; width: min(460px, calc(100% - var(--page-gutter) * 2)); margin: 0 auto; text-align: center; }
.hero-copy h1 { margin: 0 0 clamp(24px, 4vh, 40px); font-size: clamp(30px, 4vw, 48px); line-height: 1.2; }
/* The height is reserved before the first name arrives, so the action below never jumps. */
.random-result { min-height: 176px; }
#random-loading { padding-top: var(--space-6); color: var(--faint); }
.name-cluster { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 6px; width: 100%; min-width: 0; container-type: inline-size; --name-action-reserve: 100px; }
.name-reading { grid-column: 2; justify-self: center; display: flex; align-items: flex-end; justify-content: center; margin: 0; line-height: 1; letter-spacing: 0; white-space: nowrap; --name-fit: 3.7; font-size: var(--name-size); font-size: min(var(--name-size), calc((100cqi - var(--name-action-reserve)) / var(--name-fit))); }
html[lang] .name-reading { letter-spacing: 0; line-height: 1; }
.name-reading[data-syllables="1"] { --name-fit: 1.3; }
.name-reading[data-syllables="2"] { --name-fit: 2.5; }
.name-reading[data-syllables="4"] { --name-fit: 4.96; }
.name-reading[data-syllables="5"] { --name-fit: 6.2; }
.name-family, .name-given { display: flex; align-items: flex-end; }
.name-family { margin-inline-end: .32em; }
.name-syllable { display: flex; flex-direction: column; align-items: center; min-width: 1.05em; padding-inline: .08em; }
.syllable-pinyin { margin-bottom: .18em; color: var(--faint); font: 500 clamp(11px, 2.2vw, 14px)/1.15 var(--serif); white-space: nowrap; }
.syllable-char { font-family: var(--brush); font-synthesis: none; font-style: normal; line-height: 1; }
.name-actions { grid-column: 3; justify-self: start; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.name-action { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); }
.name-action svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.name-action:enabled:hover { color: var(--accent); background: var(--wash); }
.name-action:disabled { background: none; }
.home-meaning { max-width: 28em; margin: var(--space-2) auto var(--space-3); font: 500 17px/1.55 var(--display-font); text-wrap: balance; }
.home-meaning > :first-child { font-weight: 600; }
html[lang="en"] .home-meaning > :first-child::after { content: " "; }
#speech-status { margin: 0 0 var(--space-2); }
.claim-button { width: 100%; }
.home-entries { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-1) var(--space-6); margin-top: var(--space-3); }
.entry-link { display: inline-block; min-height: 44px; padding-block: 4px; color: var(--ink); font: 500 var(--text-sm)/1.6 var(--sans); text-align: center; text-decoration: none; }
.entry-link small { display: block; color: var(--faint); font-size: var(--text-xs); font-weight: 400; }
.entry-link:hover { color: var(--accent); }

/* 7. Custom naming: a note on the left, one sheet of paper for the form. */
.form-card { padding: var(--panel-padding); border-radius: var(--radius-paper); background: var(--card); }
.result-nav { display: flex; align-items: center; margin-block: var(--space-3) var(--space-4); }
.form-layout, .result-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: var(--layout-gap); align-items: start; padding-bottom: var(--space-6); }
.section-intro { padding-top: var(--panel-padding); }
.section-intro h2 { font-size: var(--page-title-size); }
.section-intro > p { color: var(--muted); }
@media (min-width: 641px) {
  /* Only a column that fits the viewport is pinned (measured in script, no scroll handler). */
  .result-aside[data-fits-viewport], .form-layout > .section-intro[data-fits-viewport] { position: sticky; top: var(--column-stick-top); }
}
.custom-receipt { margin-bottom: var(--space-4); padding: var(--space-3); border-radius: var(--radius-paper); background: var(--card); }
.custom-receipt h2 { font-size: var(--text-lg); }
.custom-receipt p { font-size: var(--text-sm); }
.input-pair, .meaning-grid, .style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.input-pair .field { margin-bottom: 0; }
.meaning-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#meaning-count { margin-inline-start: 4px; }
.aspiration-entry input[type="text"] { height: 100%; border-radius: var(--radius-chip); text-align: center; }
.style-grid { grid-auto-rows: 1fr; margin-top: var(--space-1); }
.style-choice > span { flex-direction: column; align-items: flex-start; min-height: 80px; padding: 12px var(--space-2); border-radius: var(--radius-control); }
.style-choice strong { font-size: var(--text-sm); font-weight: 500; }
.style-choice small { font-size: var(--text-xs); font-weight: 400; line-height: 1.7; color: inherit; }
.priority-grid { display: grid; gap: var(--space-1); margin-top: var(--space-1); }
.priority-grid .choice > span { justify-content: flex-start; padding: 12px var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--card); color: var(--ink); font-weight: 400; line-height: 1.6; }
.priority-grid .choice > span::before { content: ""; flex: 0 0 14px; width: 14px; height: 14px; margin-inline-end: 12px; border: 1px solid currentColor; border-radius: 50%; }
.priority-grid .choice input:checked + span { border-color: var(--ink); background: var(--card); color: var(--ink); font-weight: 400; }
.priority-grid .choice input:checked + span::before { background: var(--ink); box-shadow: inset 0 0 0 3px var(--card); }
.priority-grid .choice input:enabled:hover + span { background: var(--wash); }
#birth-fields > legend { width: 100%; margin-bottom: 0; }
#birth-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 4px 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; }
#birth-toggle::after { content: ""; flex: none; width: 9px; height: 9px; margin-inline-end: 5px; border: solid var(--ink); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
#birth-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
/* Collapsed, the optional section is one line: its note belongs to the opened section. */
#birth-fields:has(#birth-content[hidden]) > #birth-help { display: none; }
#birth-help { max-width: 62ch; margin: 0; }
#birth-content { padding-top: var(--space-2); }
.birth-group { margin-bottom: var(--space-3); }
.birth-group > legend { font-size: var(--text-sm); }
.birth-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.date-parts { grid-template-columns: 1.24fr 1fr 1fr; }
.birth-parts label { display: block; min-width: 0; color: var(--faint); font-size: var(--text-sm); }
.birth-parts select { margin-top: 4px; }
.geo-combo { position: relative; min-width: 0; }
.geo-combo label { display: block; margin-bottom: var(--space-1); font-size: var(--text-sm); font-weight: 600; line-height: 1.5; }
.geo-combo input[type="text"] { padding-inline-end: 44px; }
.city-clear { position: absolute; bottom: 0; inset-inline-end: 0; display: grid; place-items: center; width: 44px; min-height: 0; height: var(--control-height); padding: 0; border: 0; border-radius: var(--radius-control); background: none; color: var(--faint); font-size: 22px; line-height: 1; }
.city-clear:hover { color: var(--ink); }
.city-hits { position: absolute; z-index: 5; top: 100%; inset-inline: 0; max-height: 220px; margin: 4px 0; padding: 4px; overflow: auto; overscroll-behavior: contain; list-style: none; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--card); box-shadow: var(--shadow); }
.city-hits [role="option"] { min-height: 44px; padding: 10px 12px; border-radius: 4px; line-height: 1.5; cursor: pointer; overflow-wrap: anywhere; }
.city-hits [role="option"]:not([aria-disabled]):hover, .city-hits [aria-selected="true"] { background: var(--wash); }
.city-hits [aria-disabled="true"] { color: var(--muted); font-size: var(--text-sm); cursor: default; }
.city-status:not(.sr-only), .city-confirmation { margin: var(--space-1) 0 0; }
.city-confirmation { padding: 6px 12px; border-inline-start: 2px solid var(--ink); font-size: var(--text-sm); overflow-wrap: anywhere; }
.city-confirmation p { margin: 0; }
.bazi-submit-note { font-size: var(--text-sm); }
.wish-field { margin-bottom: var(--space-3); }
.wish-field label { font-weight: 600; }
.custom-submit { display: flex; flex-direction: column-reverse; gap: var(--space-1); margin-top: var(--space-2); }
.custom-submit .pricing-note { margin: 0; color: var(--faint); font-size: var(--text-sm); text-align: center; }
#custom-invite-owner, #custom-invite-guest { margin-block: var(--space-2); font-size: var(--text-sm); }
#invite-link-display, #custom-invite-url { overflow-wrap: anywhere; user-select: text; }
#preferences-form :is(input, select, textarea, button) { scroll-margin-top: 6px; }

/* 8. A name and its reading: the name card on the left, hairline-separated notes on the right. */
.result-aside { min-width: 0; }
.result-cover { position: relative; padding: 44px var(--panel-padding) var(--panel-padding); border: 1px solid var(--control); border-radius: var(--radius-paper); background: var(--card); box-shadow: var(--shadow); text-align: center; }
/* Four corner ticks are the card's only ornament. */
.result-cover::after { content: ""; position: absolute; inset: 6px; pointer-events: none; background: linear-gradient(var(--control), var(--control)) left top / 18px 1px, linear-gradient(var(--control), var(--control)) left top / 1px 18px, linear-gradient(var(--control), var(--control)) right top / 18px 1px, linear-gradient(var(--control), var(--control)) right top / 1px 18px, linear-gradient(var(--control), var(--control)) left bottom / 18px 1px, linear-gradient(var(--control), var(--control)) left bottom / 1px 18px, linear-gradient(var(--control), var(--control)) right bottom / 18px 1px, linear-gradient(var(--control), var(--control)) right bottom / 1px 18px; background-repeat: no-repeat; }
.result-cover .eyebrow { margin: 0; }
.large-name, .locked-name { margin: var(--space-3) 0 var(--space-1); font: 400 var(--name-size)/1.3 var(--chinese); letter-spacing: .06em; word-break: keep-all; }
#result-name, .locked-name { font-family: var(--brush); font-synthesis: none; font-style: normal; }
.name-mask { color: var(--control); }
.pinyin, .syllable { font: 400 24px/1.5 var(--serif); letter-spacing: .02em; }
.result-reading { display: flex; align-items: center; justify-content: center; gap: var(--space-1); margin-bottom: var(--space-2); min-width: 0; }
.result-reading .pinyin { min-width: 0; margin: 0; }
.result-summary { margin-bottom: var(--space-2); font-size: var(--text-md); text-wrap: balance; }
.result-themes { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-1); }
.result-themes span { padding: 2px 12px; border-radius: var(--radius-chip); background: var(--wash); font-size: var(--text-xs); }
.card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-3); margin-top: var(--space-2); }
#copy-status { margin: 0; overflow-wrap: anywhere; }
#copy-status:empty { display: none; }
.refine-panel { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.refine-panel p { color: var(--faint); font-size: var(--text-sm); }
.refine-panel .button { width: 100%; }
.refine-button .entry-arrow::before { content: "→"; }
.result-details { padding-top: var(--panel-padding); }
.result-details > :first-child { margin-top: 0; }
.detail-section { margin-bottom: var(--space-6); }
.detail-section + .detail-section { padding-top: var(--space-6); border-top: 1px solid var(--line); }
.detail-section > :last-child { margin-bottom: 0; }
.detail-section > p:not(.eyebrow):not(.fine-print) { color: var(--muted); }
.cultural-callout { margin-bottom: var(--space-4); padding: 12px var(--space-2); border-inline-start: 2px solid var(--ink); background: var(--wash); }
.cultural-callout p { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.pronunciation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-2); margin-block: var(--space-3); }
.pronunciation-card { min-width: 0; padding-inline-start: var(--space-2); border-inline-start: 1px solid var(--line); }
.tone-path { display: block; font-size: var(--text-lg); line-height: 1.5; }
.syllable { margin-bottom: 4px; }
.tone-label { margin-bottom: var(--space-1); color: var(--faint); font-size: var(--text-xs); }
.sound-cue { margin: 0; font-size: var(--text-xs); line-height: 1.7; overflow-wrap: anywhere; }
.character-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-3); padding-block: var(--space-2); }
.character-row p { overflow-wrap: anywhere; }
.character-row p:last-child { margin: 0; }
.meaning-character { font: 400 56px/1.25 var(--chinese); }
.character-meta { margin-bottom: var(--space-1); color: var(--faint); font-size: var(--text-sm); }
.check-label { display: inline-block; margin-bottom: var(--space-2); color: var(--faint); font-size: var(--text-xs); }
.association-section ul { padding-inline-start: 20px; color: var(--muted); font-size: var(--text-sm); }
.association-section li { margin-bottom: var(--space-1); }
.calendar-pillars, .calendar-counts { display: flex; flex-wrap: wrap; gap: 4px var(--space-2); padding: 0; list-style: none; }
#calendar-reading p, #surname-origin-source { overflow-wrap: anywhere; }
#owner-inputs { display: grid; grid-template-columns: fit-content(42%) minmax(0, 1fr); gap: var(--space-1) var(--space-2); margin: 0; }
#owner-inputs dt { color: var(--faint); }
#owner-inputs dd { margin: 0; overflow-wrap: anywhere; }
.locked-contents { margin: var(--space-3) 0; padding-inline-start: 1.2em; }
.locked-contents li { padding: var(--space-1) 0 var(--space-1) .25em; }
.locked-price { color: var(--faint); }
.locked-details .button { width: 100%; }
/* The claim dialog and its email preview. */
#claim-email-form { margin-block: var(--space-3); }
#claim-email-help, #claim-status { color: var(--muted); font-size: var(--text-sm); }
#claim-status { margin: var(--space-2) 0 0; }
.email-paper { margin-block: var(--space-3); padding: var(--space-3); border-radius: var(--radius-paper); background: var(--card); }
.email-brand .brand-name { font-size: 32px; }
.email-recipient, .email-subject { color: var(--faint); font-size: var(--text-xs); }
#email-body { display: grid; justify-items: center; gap: var(--space-1); padding-top: var(--space-2); text-align: center; }
#email-name { margin: 0; font: 400 38px/1.35 var(--chinese); }
#email-purpose, #email-invitation { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.email-invite { justify-self: stretch; padding: var(--space-2); background: var(--paper); text-align: start; }
.marketing-option { display: flex; align-items: flex-start; gap: var(--space-2); min-height: 48px; font-size: var(--text-sm); cursor: pointer; }
.marketing-option input { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; margin: 4px 0; accent-color: var(--ink); }
.marketing-option small { display: block; margin-top: var(--space-1); color: var(--faint); font-size: var(--text-xs); }

/* 9. Sign-in and the account: one narrow, left-aligned column. */
.auth-view { max-width: var(--auth-width); padding-block: var(--space-6) var(--space-8); }
.auth-intro { margin-bottom: var(--space-3); color: var(--faint); font-size: var(--text-sm); }
.auth-form .field { margin-bottom: var(--space-2); }
.auth-form > .button, .auth-form > div > .button { width: 100%; margin-top: var(--space-1); }
.auth-step-title { font-size: var(--text-lg); margin-bottom: var(--space-1); }
/* The code and its Send button are one row: the first step sits where the eye already is. */
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1); }
.code-row .button { min-width: 7.5em; padding-inline: 12px; white-space: nowrap; }
.auth-view .large-name { font-size: var(--text-2xl); }
.my-view { max-width: 760px; padding-block: var(--space-6) var(--space-8); }
.my-account { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin: 0; color: var(--faint); font-size: var(--text-sm); }
.account-email { overflow-wrap: anywhere; }
.my-section { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.my-section h2 { font-size: var(--text-lg); }
.my-section > p { color: var(--muted); font-size: var(--text-sm); }
/* A saved name is one summary row: the name at 40px, its reading, and two quiet actions. */
.my-item { display: grid; grid-template-columns: minmax(3.4em, auto) minmax(0, 1fr) auto; align-items: center; gap: 4px var(--space-3); padding-block: 12px; border-bottom: 1px solid var(--line); }
.my-item:last-child { border-bottom: 0; }
.my-item-text:first-child { grid-column: 1 / 3; }
/* Delete is always there but quiet: red belongs to the confirmation, not to every row. */
.my-item .danger-action:not(:hover) { color: var(--faint); }
.my-name { color: var(--ink); font: 400 var(--text-2xl)/1.2 var(--chinese); letter-spacing: .06em; text-decoration: none; white-space: nowrap; }
.my-name:hover { color: var(--accent); }
.my-item p { margin: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.my-item .pinyin { font-size: var(--text-md); }
.my-meta { color: var(--faint); font-size: var(--text-xs); }
.my-item-title { margin: 0; font: 500 var(--text-md)/1.5 var(--sans); letter-spacing: 0; }
.my-item-actions { display: flex; align-items: center; gap: var(--space-2); }
.invite-link { margin: 0 0 var(--space-1); color: var(--ink); font-size: var(--text-sm); }
.invite-link:empty { display: none; }
.account-danger h2 { font-size: var(--text-md); font-family: var(--sans); font-weight: 600; letter-spacing: 0; }

/* 10. Terms and privacy: a reading measure, room between long paragraphs, ruled sections. */
.legal-view { padding-block: var(--space-4) var(--space-8); }
.legal-paper { max-width: 68ch; margin: var(--space-4) auto 0; }
.legal-paper h2 { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: var(--text-lg); scroll-margin-top: var(--space-8); }
.legal-paper p, .legal-paper li { line-height: 1.9; overflow-wrap: anywhere; }
.legal-paper p { margin-bottom: 1.25em; }
.legal-paper ul { padding-inline-start: 1.4em; }
.legal-paper li { margin-bottom: .9em; }
.legal-paper > :last-child { margin-bottom: 0; }

/* 11. Narrow screens, forced colours and reduced motion. */
@media (max-width: 1100px) {
  .brand-motto { display: none; }
}
@media (max-width: 900px) {
  /* Paper stays empty where there is no room for names beside the column. */
  .name-field { display: none; }
  .hero-scene { min-height: 0; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 12px; }
  .demo-strip { position: static; }
  /* Brand and tools share one row above the two sections. */
  .masthead-inner { flex-wrap: wrap; min-height: 0; }
  .header-signature { flex: 1 1 auto; align-items: center; min-height: 56px; }
  .brand-name { font-size: 32px; }
  .site-tools { flex: none; gap: 4px; }
  .site-nav { order: 3; flex: 0 0 100%; gap: 0; }
  .site-nav a { flex: 1 1 0; min-height: 46px; font-size: 18px; }
  .site-nav a[aria-current]::after { inset-inline: 0; }
  .form-layout { grid-template-columns: 1fr; gap: var(--space-3); }
  .result-layout { grid-template-columns: 1fr; gap: var(--space-4); }
  .section-intro, .result-details { padding-top: 0; }
  .result-nav { margin-block: var(--space-1) var(--space-2); }
  .result-cover { padding: 36px var(--space-3) var(--space-3); }
  .character-row { grid-template-columns: 60px minmax(0, 1fr); gap: var(--space-2); }
  .meaning-character { font-size: 48px; }
  .my-item { grid-template-columns: minmax(0, 1fr) auto; }
  .my-name { grid-column: 1 / -1; font-size: 36px; }
  dialog { max-height: calc(100dvh - 28px); }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .button, .custom-receipt .button { width: 100%; }
}
@media (max-width: 440px) {
  .meaning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .name-cluster { column-gap: 2px; --name-action-reserve: 92px; }
  .name-family { margin-inline-end: .22em; }
  .birth-parts { gap: 6px; }
  .birth-parts select { padding-inline: 8px 26px; background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; }
}
@media (max-width: 360px) {
  .masthead-inner { column-gap: var(--space-1); }
  .account-link > span { padding-inline: 10px; }
  .account-link svg { display: none; }
  .style-grid, .input-pair { grid-template-columns: 1fr; }
  .code-row .button { min-width: 6em; padding-inline: 8px; }
}
@media (forced-colors: active) {
  .button, .icon-button, .choice > span { border: 1px solid ButtonText; }
  .choice input:checked + span, .language-switch [aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .choice input:focus-visible + span { outline-color: Highlight; }
  button:disabled, .choice input:disabled + span { border-color: GrayText; color: GrayText; }
  .loading-mark, .brand-name::after { background: CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-play-state: paused !important; transition: none !important; }
  .loading-mark { opacity: 1; }
}
