:root {
  color-scheme: light;
  --canvas: #faf9f6;
  --surface: #f0eee9;
  --field: #fffefa;
  --ink: #202927;
  --secondary: #515751;
  --muted: #636760;
  --line: #dedbd2;
  --action: #304f49;
  --action-hover: #203933;
  --selection: #e5ece6;
  --error: #a52727;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --name: "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", "Songti TC", serif;
  --content: 1080px;
  --gutter: clamp(20px, 5vw, 72px);
  --header-height: 54px;
  --radius: 22px;
  --fast: 160ms;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font: 400 1rem/1.60 var(--sans);
  color: var(--ink);
  background: var(--canvas);
}

h1, h2, h3, h4, h5, p, figure { margin: 0; }
h1, h2, h3 { font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.22; letter-spacing: -.04em; }
h3 { font-size: 1.17rem; line-height: 1.35; letter-spacing: -.015em; }
h4, h5 { font-size: 1rem; line-height: 1.4; font-weight: 650; }
p, dd, li { overflow-wrap: anywhere; }
a { color: var(--action); text-underline-offset: .19em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[role="status"]:empty { display: none; }

:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 4px;
}
h1:focus, h2:focus, h3:focus { outline: none; }

.shell {
  width: min(var(--content), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}
main.shell { flex: 1; }
.screen { animation: screen-in 210ms ease-out both; }
@keyframes screen-in { from { opacity: .55; transform: translateY(5px); } }

.skip-link, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus-visible {
  z-index: 20;
  width: auto;
  height: auto;
  top: 10px;
  left: 10px;
  padding: 8px 14px;
  clip-path: none;
  background: var(--canvas);
  border-radius: 8px;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: rgba(250, 249, 246, .97);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(18px)) {
  .site-header { background: rgba(250, 249, 246, .9); backdrop-filter: blur(18px); }
}

.header-inner {
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.header-inner a { text-decoration: none; }
.brand { width: max-content; color: var(--ink); font-weight: 700; line-height: 1.3; }
.desktop-nav { align-self: stretch; display: flex; gap: clamp(18px, 4vw, 45px); }
.desktop-nav a, .header-methods {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: .875rem;
  color: var(--secondary);
}
.desktop-nav a { position: relative; }
.desktop-nav a[aria-current="page"], .header-methods[aria-current="page"] { color: var(--action); }
.desktop-nav a[aria-current="page"]::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: currentColor;
  content: "";
}
.header-methods { justify-self: end; }
.mobile-quick-nav { display: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 7vw, 105px);
  padding-block: clamp(55px, 7vw, 92px);
}
.hero-copy h1 {
  font-size: clamp(3.25rem, 6vw, 5.1rem);
  line-height: 1.04;
  letter-spacing: -.06em;
  font-weight: 720;
}
.hero-copy p {
  max-width: 23em;
  margin-top: 19px;
  font-size: clamp(1rem, 1.65vw, 1.19rem);
  line-height: 1.62;
  color: var(--secondary);
}
.hero-start { margin-top: 25px; }

.name-preview {
  min-width: 0;
  min-height: 294px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 47px);
  color: #f7f8fb;
  background: #253431;
  border-radius: 28px;
}
.name-preview-label { color: #cdd6e2; font-size: .82rem; font-weight: 550; }
.name-preview-identity {
  display: flex;
  flex-wrap: wrap;
  column-gap: clamp(22px, 4vw, 52px);
  margin: 17px 0 16px;
}
.name-preview-identity > div { display: grid; gap: 3px; }
.name-preview-kanji {
  color: #fff;
  font: 600 clamp(3.1rem, 5.6vw, 5.4rem)/1.16 var(--name);
  letter-spacing: -.045em;
}
.name-preview-kana { font-size: clamp(.96rem, 1.85vw, 1.13rem); color: #d7dfeb; }
.name-preview .pronunciation-controls { margin-top: 0; }
.name-preview .pronunciation-button {
  color: #f8fbff;
  background: #394b44;
}
.name-preview .pronunciation-button:hover { background: #4a5c54; }
.name-preview .pronunciation-status { color: #d7dfeb; }
.name-preview :focus-visible { outline-color: #a7ceff; }

.button {
  min-height: 44px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 18px;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  font-size: .91rem;
  font-weight: 590;
  transition: color var(--fast), background-color var(--fast), border-color var(--fast);
}
.button-primary { color: #fff; background: var(--action); }
.button-primary:hover:not(:disabled) { background: var(--action-hover); }
.button-outline { color: var(--action); background: var(--selection); }
.button-outline:hover:not(:disabled) { background: #d7e3da; }
.button-text { padding-inline: 3px; color: var(--action); background: transparent; border-radius: 6px; }
.button-text:hover:not(:disabled) { text-decoration: underline; }
.button:disabled { color: #6a6c74; background: #e5e5e9; }

.workbench {
  min-width: 0;
  padding: clamp(22px, 4.1vw, 46px);
  border-radius: var(--radius);
  background: var(--surface);
}
.screen:not([data-screen="personal"]) { padding-top: clamp(30px, 6.3vw, 72px); }
.screen:not([data-screen="personal"]) > .workbench > .workbench-heading h1, .methods h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.13;
  letter-spacing: -.045em;
}
.workbench-heading, .section-heading, .family-member-heading, .personal-workbench-heading, .ai-explanation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
}
.workbench-heading { margin-bottom: 22px; }
.family-intro, .history-intro {
  margin: -11px 0 25px;
  color: var(--secondary);
  max-width: 42em;
}
form { min-width: 0; }
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
legend {
  padding: 0;
  margin-bottom: 9px;
  font-size: 1.04rem;
  line-height: 1.3;
  font-weight: 650;
}
label {
  min-width: 0;
  display: grid;
  gap: 5px;
  font-size: .89rem;
  color: var(--secondary);
  font-weight: 550;
}
input:not([type="checkbox"], [type="radio"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #d7d8dd;
  border-radius: 10px;
  color: var(--ink);
  background: var(--field);
  font-size: 1rem;
  font-weight: 450;
}
input::placeholder { color: #6b6d77; opacity: 1; }
input[type="date"], input[type="time"] { display: block; text-align: start; }
input::-webkit-date-and-time-value { text-align: start; }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 33px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--secondary) 50%),
    linear-gradient(135deg, var(--secondary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
select:disabled, input:disabled { opacity: .65; }

.form-layout, .analysis-grid, .compatibility-people, .family-analysis-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3.2vw, 36px);
}
.form-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 21px;
}
.birth-column {
  border-inline-start: 1px solid var(--line);
  padding-inline-start: clamp(15px, 2.9vw, 33px);
}
.field-grid, .family-father-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.family-father-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-help, .candidate-source, .candidate-romanization, .family-pillar-text, .history-status {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 400;
  line-height: 1.55;
}
.field-help + .field-help { margin-top: 4px; }
.field-help:not(:empty) { margin-block: 7px 0; }
.birthplace-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
}
.birth-zone, [data-place-matches], [data-member-birth] > fieldset, [data-compat-birth] > fieldset {
  margin-top: 11px;
}
.birth-advanced { margin-top: 11px; }
.name-gender-field { font-size: .98rem; color: var(--ink); }
.name-gender-field .field-help:not(:empty) { margin: 0; }
.full-name-length-help { margin: 0 0 8px !important; }
.name-character-options { margin-top: 12px; }
[data-keep-character] { margin-top: 10px; }

.mode-control, .ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: #e6e4dd;
}
.mode-control label { flex: 1 1 0; position: relative; cursor: pointer; }
.mode-control input, .meaning-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.mode-control span, .ranking-tab {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 5px 8px;
  text-align: center;
  border: 0;
  border-radius: 9px;
  color: var(--secondary);
  font-size: .88rem;
  line-height: 1.3;
  font-weight: 560;
  background: transparent;
}
.mode-control input:checked + span, .ranking-tab[aria-selected="true"] {
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 1px 2px #171a2417;
  font-weight: 650;
}
.mode-control input:focus-visible + span, .meaning-options input:focus-visible + span {
  outline: 2px solid var(--action);
  outline-offset: -1px;
}
.full-name-length-options span { white-space: nowrap; padding-inline: 4px; }
.meaning-preferences { margin-top: 18px; }
.meaning-options { display: flex; flex-wrap: wrap; gap: 6px; }
.meaning-options label { position: relative; cursor: pointer; }
.meaning-options span {
  min-height: 44px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}
.meaning-options input:checked + span { color: var(--action); background: var(--selection); border-color: #a1b4a7; }

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 13px;
  margin-top: 25px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.form-footer .field-help { margin: 0; }
.form-error, .result-notices {
  margin-top: 12px;
  padding: 10px 13px;
  background: #fff1f0;
  border-radius: 10px;
  color: var(--error);
  font-size: .91rem;
}
.result-notices { color: var(--secondary); background: var(--surface); }
.result-notices .plain-list { margin-top: 0; }

details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding-block: 7px;
  list-style-type: none;
  cursor: pointer;
  color: var(--action);
  font-size: .89rem;
  font-weight: 560;
}
summary::-webkit-details-marker { display: none; }
details > summary::after {
  flex: 0 0 auto;
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-inline: 3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  content: "";
}
details[open] > summary::after { transform: translateY(2px) rotate(225deg); }
details[open] > summary { margin-bottom: 5px; }
details.card-detail:not(.life-reading-baseline, .life-reading-evidence) { border-top: 1px solid var(--line); }
details.card-detail > :is(p, ol, ul, dl) { margin-bottom: 10px; }
.personal-preference-panel > fieldset, .family-member-preferences > div { margin-top: 5px; }

.results { margin-top: clamp(45px, 7.5vw, 82px); }
.results > .section-heading { margin-bottom: 17px; }
.section-heading p { margin-top: 5px; color: var(--muted); font-size: .92rem; }
.analysis-card {
  min-width: 0;
  padding: clamp(15px, 2.3vw, 24px);
  background: var(--surface);
  border-radius: 16px;
}
.analysis-card > h3:first-child { margin-bottom: 7px; }
.analysis-grid { gap: 13px; }
.analysis-grid > .analysis-card { background: var(--canvas); border: 1px solid var(--line); }
.personal-reading-modes { width: max-content; max-width: 100%; margin: 13px 0 0; }
.ranking-tab { flex: 1 1 auto; padding-inline: 13px; }
.ranking-tab:hover:not([aria-selected="true"]) { background: #dddfe5; }
.personal-reading-panel { margin-top: 7px; }
.result-chart-detail > summary { margin: 0; }
.result-chart-detail[open] { margin-bottom: 13px; }

.suggestions-heading { margin-top: 32px; margin-bottom: 12px; align-items: end; }
.suggestions-heading h3 { font-size: clamp(1.28rem, 2.5vw, 1.66rem); }
.suggestions-heading p { font-size: .79rem; text-align: end; }
.ranking-panel { margin-top: 11px; }
.ranking-tabs:not(.personal-reading-modes) { width: max-content; max-width: 100%; }
.suggestions, .family-options, .history-list, .compatibility-dimensions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 13px;
}
.candidate, .history-card, .family-option {
  min-width: 0;
  padding: clamp(16px, 2.8vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--canvas);
}
.candidate-heading { display: flex; justify-content: space-between; align-items: start; gap: 8px 17px; }
.candidate-heading > div { min-width: 0; }
.candidate-name, .selected-name-text {
  font: 600 clamp(1.6rem, 3.2vw, 2.4rem)/1.2 var(--name);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.candidate-reading { margin-top: 4px; font-size: .99rem; color: var(--secondary); }
.candidate-meta, .candidate-top {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 2px;
  font-size: .79rem;
  line-height: 1.45;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.candidate-score { color: var(--ink); font-weight: 650; font-size: .87rem; }
.candidate > details { margin-top: 9px; }
.candidate-source { margin-top: 8px; }
.pronunciation-controls { margin-top: 10px; }
.pronunciation-controls audio { display: block; width: 100%; height: 39px; margin-top: 7px; }
.pronunciation-button::before {
  width: 0;
  height: 0;
  border: solid transparent;
  border-width: 5px 0 5px 8px;
  border-left-color: currentColor;
  content: "";
}
.pronunciation-status:not(:empty) { margin-top: 6px; }

.personal-workbench { margin-block: 13px; }
.personal-workbench-controls, .personal-candidate-actions, .personal-round-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.personal-candidate-actions { margin-top: 8px; }
.personal-candidate-actions .button { padding-inline: 10px; }
.personal-candidate-actions [aria-pressed="true"] { color: var(--ink); background: #e5e7ec; }
.personal-shortlist { padding: 0; margin: 11px 0 0; list-style: none; }
.personal-shortlist li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-block: 6px;
  border-top: 1px solid var(--line);
}
.personal-shortlist li > span { display: grid; overflow-wrap: anywhere; }
.personal-rounds, .personal-finalists, .personal-selected-name { margin-top: 21px; }
.personal-round-group + .personal-round-group { margin-top: 18px; }
.personal-round-actions, .personal-finalist-first { margin-top: 10px; }
.personal-finalist-first { max-width: 510px; margin-bottom: 12px; }
.selected-name-fit { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 7px; color: var(--secondary); font-size: .86rem; }
.reading-plain-text { margin-top: 4px; white-space: pre-wrap; }

.empty-result { padding: 16px; border-radius: 10px; background: var(--surface); color: var(--secondary); }
#ranking-more, .history-more { margin-top: 12px; }

.pillars, .palace-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  margin: 10px 0;
  list-style: none;
}
.pillar, .palace-grid > li {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 6px;
  border-radius: 6px;
  background: var(--surface);
}
.pillar-label, .pillar-elements, .pillar-ten-god { color: var(--muted); font-size: .74rem; line-height: 1.4; }
.pillar-ganzhi { font-size: 1.15rem; line-height: 1.25; }
.palace-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr)); }
.palace-grid > li { font-size: .82rem; }
.element-meters { display: grid; gap: 5px; margin-block: 11px; }
.element-meter { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 9px; }
.element-meter > span { display: flex; justify-content: space-between; font-size: .84rem; }
.element-meter progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  appearance: none;
  background: #e8ebf0;
}
.element-meter progress::-webkit-progress-bar { background: #e8ebf0; }
.element-meter progress::-webkit-progress-value { background: var(--action); border-radius: 5px; }
.element-meter progress::-moz-progress-bar { background: var(--action); border-radius: 5px; }
.meters-entered progress { animation: meter-in 450ms cubic-bezier(.18, .65, .32, 1) both; transform-origin: left; }
@keyframes meter-in { from { transform: scaleX(.06); opacity: .5; } }
.chart-meta { margin-block: 9px; font-size: .88rem; color: var(--secondary); }
.chart-meta p + p { margin-top: 3px; }
.chart-meta b { color: var(--ink); }
.chart-trace, .ai-report-evidence {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 4px 10px;
  margin-block: 8px;
  font-size: .84rem;
}
.chart-trace dt, .ai-report-evidence dt { color: var(--muted); }
.chart-trace dd, .ai-report-evidence dd { margin: 0; }
.plain-list, .trigram-list { margin-block: 8px; padding-inline-start: 1.3em; color: var(--secondary); font-size: .88rem; }
.plain-list li + li, .trigram-list li + li { margin-top: 4px; }
.character-list, .score-breakdown { padding: 0; margin-block: 10px; list-style: none; }
.character-row { display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 5px 8px; padding-block: 7px; }
.character-row + .character-row, .score-breakdown li + li { border-top: 1px solid var(--line); }
.character-glyph { font: 650 1.25rem/1.35 var(--name); }
.row-heading { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; }
.character-row p, .row-heading, .character-role, .character-part { font-size: .83rem; color: var(--secondary); }
.favorable-analysis, .ziwei-summary { margin-top: 12px; }
.score-breakdown li, .score-breakdown li > div { font-size: .87rem; line-height: 1.55; }
.score-breakdown li { padding-block: 5px; }
.score-breakdown li > div { display: flex; justify-content: space-between; gap: 6px; }

.ai-explanation { margin-block: 12px; }
.ai-explanation > h3:has(+ .life-reading-baseline) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.life-reading-baseline > summary { font-size: 1.07rem; color: var(--ink); padding: 0; }
.life-reading-baseline > summary::after { color: var(--action); }
.life-reading-baseline[open] > summary { margin-bottom: 7px; }
.life-reading-card {
  display: grid;
  grid-template-columns: minmax(112px, .24fr) minmax(0, 1fr);
  align-items: start;
  gap: 5px 22px;
  padding: 15px 0 11px;
  border-top: 1px solid var(--line);
}
.life-reading-card > :is(h4, h5) { grid-column: 1; font-size: .99rem; }
.life-reading-card > :not(h4, h5) { grid-column: 2; }
.life-reading-card > p, .ai-explanation-text { font-size: .95rem; line-height: 1.6; white-space: pre-wrap; }
.life-reading-watch { color: var(--secondary); font-weight: 600; }
.ai-report-next-step { color: var(--secondary); }
.ai-report-next-step strong { font-weight: 650; margin-inline-end: .55em; }
.life-reading-evidence > summary { min-height: 36px; font-size: .79rem; width: max-content; max-width: 100%; }
.ai-report-evidence { display: block; }
.ai-report-evidence > div { display: grid; grid-template-columns: minmax(105px, .34fr) minmax(0, 1fr); gap: 3px 11px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.life-reading-source { display: inline-block; margin-inline-start: 8px; font-size: .79rem; }
.life-reading-provider, .ai-explanation-output { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.ai-report-conclusion { padding: 8px 0; }
.ai-explanation-pointers, .life-reading-highlights { margin: 3px 0; padding-inline-start: 1.2em; font-size: .92rem; }

.family-member, #family-preferences {
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.compatibility-people { gap: 20px; }
.compatibility-people .family-member { margin: 0; border: 0; padding: 0; }
.compatibility-people .family-member + .family-member { border-inline-start: 1px solid var(--line); padding-inline-start: 20px; }
.compat-person h3 { margin-bottom: 11px; }
.family-member-heading { margin-bottom: 8px; }
.family-birth-slot { margin-top: 10px; }
.family-option .candidate { margin-top: 8px; }
.family-option:has(.candidate) { padding: 0; border: 0; }
#family-add { margin-top: 10px; }
.history-form { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr) auto; gap: 9px; align-items: end; }
.history-status { margin-top: 13px; }
.history-card h3 { font-family: var(--name); font-size: 1.45rem; }
.history-note + .history-note { margin-top: 11px; }
.history-card .plain-list { overflow-wrap: anywhere; }

.methods { max-width: 740px; }
.method-details { margin-top: 16px; }
.method-details details { border-bottom: 1px solid var(--line); padding-block: 4px; }
.method-details p { font-size: .93rem; color: var(--secondary); margin-bottom: 10px; }
.site-footer { margin-top: clamp(44px, 7vw, 85px); border-top: 1px solid var(--line); }
.site-footer > .shell { display: flex; justify-content: space-between; align-items: center; min-height: 61px; gap: 14px; }
.site-footer a { font-size: .81rem; color: var(--muted); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 880px) {
  .name-preview { min-height: 243px; border-radius: 22px; }
  .full-name-length-options label { flex-basis: 28%; }
  .family-father-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  :root { --gutter: 18px; --header-height: 47px; }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .header-inner { display: flex; justify-content: space-between; gap: 8px; }
  .desktop-nav { display: none; }
  .header-methods { font-size: .79rem; }
  .mobile-quick-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    z-index: 10;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 3px max(10px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-right));
    border-top: 1px solid var(--line);
    background: rgba(250, 249, 246, .98);
    backdrop-filter: blur(17px);
  }
  .mobile-quick-nav.is-keyboard-open { display: none; }
  .mobile-quick-nav a {
    min-height: 49px;
    display: grid;
    place-items: center;
    color: var(--secondary);
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 550;
    text-decoration: none;
  }
  .mobile-quick-nav a[aria-current="page"] { color: var(--action); background: var(--selection); font-weight: 690; }
  .hero { grid-template-columns: 1fr; gap: 23px; padding-block: 32px; }
  .hero-copy h1 { font-size: clamp(2.53rem, 11.6vw, 3.35rem); }
  .hero-copy p { margin-top: 12px; }
  .hero-start { margin-top: 16px; }
  .name-preview { min-height: 0; padding: 15px 20px 16px; border-radius: 17px; }
  .name-preview-identity { flex-wrap: nowrap; margin-block: 9px; }
  .name-preview-kanji { font-size: clamp(2.4rem, 10vw, 3.55rem); }
  .name-preview-kana { font-size: .87rem; }
  .name-preview-label { font-size: .76rem; }
  .workbench { padding: 17px 14px; border-radius: 17px; }
  .workbench-heading { margin-bottom: 16px; }
  .family-intro, .history-intro { margin-top: -5px; margin-bottom: 16px; }
  .form-layout, .analysis-grid, .suggestions, .family-options, .family-analysis-list, .history-list,
  .compatibility-people, .compatibility-dimensions { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .form-column { gap: 17px; }
  .birth-column, .compatibility-people .family-member + .family-member {
    border-inline-start: 0;
    padding-inline-start: 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .workbench .form-layout { gap: 17px; }
  .full-name-length-options { flex-wrap: wrap; }
  .full-name-length-options label { flex-basis: 29%; }
  .form-footer, .personal-workbench-heading, .ai-explanation-header { align-items: start; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .results { margin-top: 41px; }
  .suggestions-heading { align-items: start; flex-direction: column; gap: 2px; }
  .suggestions-heading p { text-align: start; }
  .personal-workbench-heading { flex-wrap: wrap; }
  .life-reading-card { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .life-reading-card > :not(h4, h5) { grid-column: 1; }
  .ai-report-evidence > div { grid-template-columns: 1fr; gap: 2px; }
  .life-reading-evidence > summary { min-height: 44px; }
  .history-form { grid-template-columns: minmax(0, 1fr) auto; }
  .history-form label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 350px) {
  :root { --gutter: 12px; }
  .header-methods { padding-inline: 0; }
  .button { padding-inline: 10px; }
  .candidate-heading { gap: 8px; }
  .workbench-heading { gap: 7px; }
  .ai-explanation-header { flex-wrap: wrap; }
  .ranking-tab { padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
