@charset "UTF-8";

:root {
  --paper: #fffaf0;
  --card: #fffdf8;
  --ink: #3d3027;
  --muted: #6e6052;
  --green: #69462f;
  --green-light: #f1e6d3;
  --line: #d9cbb5;
  --accent: #9e452e;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", serif;
  --sans: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.85 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-underline-offset: 4px; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; line-height: 1.6; }
button:disabled { cursor: default; opacity: .4; }
button, a, input, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
h1:focus { outline: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.6; font-weight: 700; }
img { max-width: 100%; height: auto; }
main { min-height: calc(100vh - 200px); }
.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: 20; padding: 10px 18px; background: white; }
.skip-link:focus { top: 10px; }
.section-shell { width: calc(100% - 64px); max-width: 1040px; margin-inline: auto; }

/* A small illustrated booklet, with the original characters on its cover. */
.site-header { width: calc(100% - 64px); max-width: 1040px; min-height: 100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 2px solid var(--ink); padding: 18px 0; }
.brand { color: var(--ink); text-decoration: none; font: 700 24px/1.4 var(--serif); letter-spacing: .035em; flex-shrink: 0; }
.brand small { display: block; color: var(--muted); font: 12px/1.5 var(--sans); letter-spacing: .04em; margin-top: 5px; }
.site-header nav { display: flex; align-items: center; gap: 24px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; background: none; padding: 7px 0; color: var(--green); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover { color: var(--accent); }
.external-icon { font-size: 17px; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: .045em; }
.hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 36px; padding: 48px 0 42px; }
.hero-copy { min-width: 0; }
.hero h1 { font-size: clamp(32px, 3.6vw, 44px); letter-spacing: .025em; line-height: 1.55; margin: 14px 0 20px; }
.hero-lead { font-size: 16px; line-height: 2; }
.hero-facts { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 7px; font-size: 14px; margin: 23px 0 18px; }
.hero-facts b { font: 700 27px/1 var(--sans); color: var(--accent); }
.hero-facts span { font-size: 13px; color: var(--muted); margin-left: 8px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 50px; border: 1.5px solid var(--ink); border-radius: 4px; padding: 12px 22px; font-size: 15px; font-weight: 700; text-decoration: none; transition: background .12s, transform .12s, box-shadow .12s; }
.primary-button { color: #fffdf8; background: var(--green); box-shadow: 3px 3px 0 var(--ink); }
.primary-button:hover { background: #513322; }
.primary-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.secondary-button { background: var(--card); color: var(--green); }
.secondary-button:hover { background: var(--green-light); }
.start-button { width: 300px; max-width: 100%; justify-content: space-between; }
.start-button span { font-size: 23px; }
.private-note { font-size: 12px; color: var(--muted); margin-top: 14px; }
.hero-art { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 7px; height: 350px; padding: 12px 0 48px; border-bottom: 1px solid var(--ink); }
.character-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 15px; min-width: 0; }
.character-card img { width: 110px; height: 185px; object-fit: contain; }
.character-middle img { width: 148px; height: 245px; }
.character-hot img { height: 197px; }
.character-card span { font-size: 12px; line-height: 1.65; text-align: center; }
.art-caption { position: absolute; bottom: 10px; right: 0; left: 0; text-align: center; color: var(--muted); font-size: 13px; }
.how-section { display: grid; grid-template-columns: 100px 1fr; gap: 24px; padding: 30px 0; border-top: 1px solid var(--line); }
.section-label h2 { font-size: 18px; }
.how-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.how-steps article { display: flex; align-items: flex-start; gap: 13px; }
.step-number { color: var(--accent); font: 700 27px/1.35 var(--serif); }
.how-steps h3 { font-size: 15px; margin: 0 0 7px; }
.how-steps p { font-size: 13px; line-height: 1.9; color: var(--muted); }
.scope-note { display: flex; align-items: flex-start; gap: 13px; border-top: 1px dashed #bca98d; border-bottom: 1px dashed #bca98d; padding: 19px 0; margin-top: 8px; margin-bottom: 34px; font-size: 14px; }
.scope-note p { font-size: 13px; line-height: 1.95; color: var(--muted); margin-top: 5px; }
.note-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1px solid var(--muted); border-radius: 50%; font: italic 15px Georgia, serif; flex-shrink: 0; margin-top: 3px; }
.site-footer { width: calc(100% - 64px); max-width: 1040px; margin: 0 auto; padding: 22px 0 28px; border-top: 1px solid var(--ink); display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; color: var(--muted); font-size: 12px; }
.site-footer > span:first-child { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.site-footer a { margin-left: auto; }
.resume-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; margin-bottom: 28px; border-left: 4px solid var(--accent); background: #f4e8d2; font-size: 15px; }
.resume-box p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; flex-shrink: 0; }

/* Questions: a readable question and four clear answer lines. */
.check-shell { width: calc(100% - 64px); max-width: 940px; margin: 0 auto; padding: 28px 0 44px; }
.check-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.back-button, .muted-link { font-size: 13px; }
.muted-link { color: var(--muted); }
.progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 9px; }
.progress-label b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.progress-track { height: 4px; background: #e5d8c0; overflow: hidden; }
.progress-track > span { display: block; height: 100%; background: var(--accent); transition: width .15s; }
.question-layout { display: grid; grid-template-columns: 155px minmax(0, 1fr); gap: 38px; margin-top: 28px; }
.question-aside { padding-top: 48px; text-align: center; }
.mini-illustration { margin: 0 auto 18px; }
.mini-illustration img { width: 113px; height: 180px; object-fit: contain; }
.question-aside p { font-size: 13px; line-height: 1.9; }
.question-period { display: block; font-size: 12px; color: var(--muted); margin-top: 12px; }
.question-card { min-width: 0; }
.question-card .eyebrow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; font-size: 14px; }
.question-number { font: 700 25px var(--serif); }
.extra-badge { color: var(--muted); font-size: 12px; font-weight: 400; padding-left: 9px; border-left: 1px solid var(--line); }
.question-card h1 { font-size: 28px; line-height: 1.65; letter-spacing: .01em; margin: 12px 0 10px; }
.question-hint { font-size: 15px; line-height: 1.9; color: var(--muted); }
.answer-options { margin: 23px 0 0; padding: 0; border: 0; display: grid; gap: 9px; min-width: 0; }
.answer-button { display: flex; align-items: center; gap: 15px; background: var(--card); border: 1px solid #b9a68a; border-radius: 3px; width: 100%; min-height: 65px; text-align: left; padding: 11px 16px; }
.answer-button:hover { border-color: var(--green); background: #f2e3c9; }
.answer-button:active { background: #e9d6b6; }
.answer-index { display: grid; place-items: center; width: 27px; height: 28px; flex-shrink: 0; border-right: 1px solid var(--line); color: var(--muted); font: 17px var(--serif); padding-right: 12px; }
.answer-text { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; flex: 1; min-width: 0; }
.answer-text strong { font-size: 16px; font-weight: 700; }
.answer-text small { font-size: 13px; color: var(--muted); }
.answer-arrow { font-size: 18px; color: var(--green); }
.answer-skip { background: transparent; border-color: transparent; min-height: 50px; }
.answer-skip .answer-index { border-color: transparent; }
.answer-skip strong { font-size: 14px; font-weight: 400; text-decoration: underline; text-underline-offset: 4px; }
.answer-skip .answer-text small { font-size: 12px; }
.question-context { color: var(--muted); font-size: 12px; line-height: 1.9; margin-top: 15px; }
.save-settings { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 18px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; font-size: 12px; color: var(--muted); }
.save-toggle { display: flex; align-items: center; gap: 9px; min-height: 32px; cursor: pointer; font-size: 13px; }
.save-toggle input { width: 17px; height: 17px; accent-color: var(--green); margin: 0; }
.storage-message { margin-top: 12px; border-left: 3px solid var(--accent); padding: 12px 16px; background: #ffedc7; font-size: 14px; }

/* Results are grouped by their meaning, rather than six identical boxes. */
.results-shell { padding-top: 26px; padding-bottom: 12px; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-bottom: 26px; margin-bottom: 28px; border-bottom: 1px solid var(--ink); }
.result-heading h1 { font-size: 30px; line-height: 1.65; margin: 13px 0; }
.result-heading > div > p:not(.eyebrow) { font-size: 15px; line-height: 1.95; color: var(--muted); max-width: 780px; }
.result-date { display: inline-block; margin-left: 13px; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.result-tags { display: flex; flex-wrap: wrap; gap: 6px 17px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.result-tags span + span { border-left: 1px solid var(--line); padding-left: 16px; }
.result-character { flex-shrink: 0; }
.result-character img { width: 105px; height: 150px; object-fit: contain; }
.observed-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 28px; padding: 17px 20px; background: #f2e5ce; border-left: 3px solid var(--accent); }
.observed-summary > span { font-size: 14px; }
.observed-summary > div { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.observed-summary button { background: none; color: var(--green); text-decoration: underline; text-underline-offset: 4px; font-size: 17px; font-weight: 700; padding: 5px 0; }
.observed-summary small { font-size: 12px; font-weight: 400; margin-left: 5px; }
.observed-summary > p { width: 100%; font-size: 13px; color: var(--muted); }
.result-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.result-section-heading .eyebrow { font-size: 12px; }
.result-section-heading h2 { font-size: 25px; margin-top: 3px; }
.result-section-heading .text-link { font-size: 13px; flex-shrink: 0; }
.small-icon { width: 17px; height: 17px; font-size: 12px; }
.result-explainer { font-size: 14px; line-height: 1.95; color: var(--muted); }
.result-explainer strong { font-weight: 700; }
.range-legend { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 15px 0 25px; font-size: 12px; color: var(--muted); }
.range-legend > span { display: flex; align-items: center; gap: 8px; }
.range-legend i { display: block; width: 21px; height: 8px; }
.legend-known { background: #73865d; }
.legend-unknown { border: 1px solid #a0a890; background: repeating-linear-gradient(125deg,#c6d0b8,#c6d0b8 2px,transparent 2px,transparent 5px); }
.patterns-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 28px; }
.pattern-family { min-width: 0; }
.family-qi { grid-column: 1 / -1; }
.family-blood { grid-column: span 2; }
.family-heading { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 9px; font-size: 14px; font-weight: 400; }
.family-heading > span { display: inline-flex; align-items: baseline; gap: 5px; font: 700 26px var(--serif); }
.family-heading small { font: 11px var(--sans); color: var(--muted); }
.family-patterns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.family-blood .family-patterns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.family-water .family-patterns { grid-template-columns: minmax(0, 1fr); }
.pattern-card { display: flex; flex-direction: column; min-width: 0; padding: 19px 0 12px; border-bottom: 1px solid var(--line); }
.pattern-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pattern-card h4 { font-size: 29px; line-height: 1.3; color: var(--pattern-color); }
.pattern-card h4 small { display: block; font: 12px/1.5 var(--sans); color: var(--muted); margin-top: 4px; }
.pattern-status { font-size: 12px; line-height: 1.7; color: var(--muted); text-align: right; }
.pattern-status.has-signals { color: var(--ink); font-weight: 700; border-bottom: 2px solid #c9944c; }
.pattern-plain { font-size: 14px; color: var(--muted); margin: 14px 0 12px; }
.score-label { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.score-label > b { font-size: 23px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-label > b > small { font-size: 12px; font-weight: 400; color: var(--muted); }
.score-label > span { font-size: 12px; color: var(--muted); }
.range-track { display: flex; height: 8px; background: #eee7db; margin-top: 10px; overflow: hidden; }
.range-known { background: var(--pattern-color); }
.range-unknown { background: repeating-linear-gradient(125deg,color-mix(in srgb,var(--pattern-color) 30%,transparent),color-mix(in srgb,var(--pattern-color) 30%,transparent) 2px,transparent 2px,transparent 5px); }
.pattern-signals { display: flex; align-content: flex-start; flex-wrap: wrap; gap: 5px 0; min-height: 55px; margin: 13px 0 4px; }
.pattern-signals > span { font-size: 12px; color: var(--muted); line-height: 1.9; }
.pattern-signals > span + span:before { content: "・"; margin: 0 3px; }
.pattern-signals > .no-signal { font-size: 12px; }
.pattern-details { font-size: 13px; margin-top: auto; align-self: flex-start; }
.range-footnote { font-size: 12px; color: var(--muted); line-height: 2; margin-top: 20px; }
.body-hints { margin-top: 34px; }
.hint-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; border-top: 1px solid var(--line); }
.body-hint { display: flex; align-items: center; gap: 22px; padding: 22px 0; }
.body-hint img { width: 78px; height: 137px; object-fit: contain; flex-shrink: 0; }
.body-hint .eyebrow { font-size: 12px; }
.body-hint h3 { font-size: 20px; margin: 5px 0 8px; }
.body-hint p { font-size: 14px; color: var(--muted); line-height: 1.95; }
.memo-section { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 26px 30px; margin-top: 24px; background: #f1e2c8; border-left: 4px solid var(--green); }
.memo-section h2 { font-size: 23px; margin-bottom: 12px; }
.memo-section p { font-size: 14px; color: var(--muted); line-height: 1.95; }
.memo-actions { display: flex; flex-direction: column; gap: 12px; min-width: 225px; }
.memo-actions > span { color: var(--muted); font-size: 12px; text-align: center; }
.answers-review { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.answers-review summary { cursor: pointer; font-size: 16px; font-weight: 700; padding: 8px 0; }
.answers-review summary span { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 12px; }
.answers-review details > p { font-size: 13px; color: var(--muted); margin: 9px 0 16px; }
.answers-review ol { margin: 0; padding-left: 28px; }
.answers-review li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.answers-review li > div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.answers-review li b { font-size: 13px; }
.answers-review .text-link { font-size: 12px; }
.result-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px 0; }
.print-only { display: none; }

/* Explanations: the same booklet, with a bounded scroll area. */
dialog { position: fixed; inset: 0; margin: auto; border: 1.5px solid var(--ink); border-radius: 6px; padding: 0; width: calc(100% - 32px); max-width: 660px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; color: var(--ink); background: var(--paper); box-shadow: 5px 6px 0 #3d30272b; }
dialog::backdrop { background: #34251a88; }
.dialog-inner { padding: 0 28px 28px; }
.dialog-heading { position: sticky; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 0 17px; background: var(--paper); z-index: 1; }
.dialog-heading h2 { font-size: 23px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; font: 27px/1 var(--sans); border: 1px solid var(--line); border-radius: 3px; background: var(--card); }
.dialog-inner p { font-size: 15px; line-height: 2; color: var(--muted); margin-top: 14px; }
.dialog-inner .text-link { font-size: 14px; margin-top: 8px; }
.dialog-note { border-left: 3px solid #bca27c; padding: 10px 16px; background: #f3e8d4; }
.dialog-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.about-families { margin: 20px 0; }
.about-families article { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); padding: 16px 0; }
.about-families article > span { font: 700 28px var(--serif); min-width: 40px; text-align: center; }
.about-families h3 { font-size: 16px; }
.about-families p { font-size: 14px; margin-top: 3px; }
.noscript { padding: 24px; border: 1px solid var(--line); margin: 25px; }

/* References stay a readable document, with the same type and margins. */
.reference-shell { width: calc(100% - 64px); max-width: 880px; margin: 36px auto 45px; }
.reference-shell h1 { font-size: 34px; margin: 12px 0 20px; }
.reference-shell h2 { font-size: 24px; margin: 34px 0 16px; }
.reference-shell h3 { font-size: 18px; margin: 23px 0 10px; }
.reference-shell p, .reference-shell li { font-size: 15px; color: var(--muted); line-height: 2; }
.reference-shell ul, .reference-shell ol { padding-left: 25px; }
.reference-shell li { padding-left: 4px; margin-top: 10px; }
.reference-shell .ref-intro { font-size: 16px; color: var(--ink); }
.reference-note { font-size: 13px !important; color: var(--muted); margin-top: 14px; }
.method-box { border-left: 4px solid var(--accent); background: #f2e6d0; padding: 20px 24px; margin: 25px 0; }
.method-box h2 { font-size: 21px; margin: 0 0 10px; }
.method-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 20px 0; }
.method-table th, .method-table td { vertical-align: top; text-align: left; padding: 13px 15px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.method-table th { color: var(--ink); background: #f2e6d0; font-weight: 700; }
.method-table td { color: var(--muted); }
.reference-card { padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: 25px; }
.reference-card .ref-tag { font-size: 12px; color: var(--accent); font-weight: 700; }
.reference-card h3 { font-size: 18px; margin: 8px 0; }
.reference-card .ref-bib { font-size: 13px; margin-bottom: 12px; }
.reference-card .ref-checked { border-left: 2px solid #bba688; padding-left: 14px; margin-top: 12px; font-size: 14px; }
.reference-card a { display: inline-block; font-size: 13px; overflow-wrap: anywhere; margin-top: 12px; }
.reference-footer { border-top: 1px solid var(--line); padding-top: 24px; }
.question-source-table { font-size: 13px; }
.question-source-table td:first-child { width: 27%; }

@media (max-width: 900px) {
  .site-header nav { gap: 15px; }
  .hero { gap: 20px; }
  .hero h1 { font-size: 35px; }
  .hero-art { height: 315px; }
  .character-card img { width: 90px; height: 160px; }
  .character-middle img { width: 112px; height: 213px; }
  .character-hot img { height: 173px; }
  .character-card span { font-size: 11px; }
  .how-section { grid-template-columns: 1fr; gap: 18px; }
  .how-steps { gap: 20px; }
  .question-layout { grid-template-columns: 120px minmax(0, 1fr); gap: 25px; }
  .question-card h1 { font-size: 25px; }
  .patterns-grid, .family-patterns { gap: 24px 20px; }
  .pattern-card-heading { flex-wrap: wrap; gap: 8px; }
  .pattern-status { text-align: left; }
  .score-label { align-items: flex-start; flex-direction: column; gap: 0; }
  .memo-section { padding: 22px; gap: 24px; }
}

@media (max-width: 650px) {
  .section-shell, .site-header, .site-footer, .check-shell, .reference-shell { width: calc(100% - 40px); }
  .site-header { min-height: 88px; gap: 12px; padding: 16px 0; }
  .brand { font-size: 20px; }
  .brand small { font-size: 11px; }
  .site-header nav { gap: 12px; }
  .site-header nav .text-link { font-size: 12px; }
  .site-header nav .text-link:first-child:not(:last-child) { display: none; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 30px 0; }
  .hero h1 { font-size: 34px; margin: 12px 0 15px; }
  .hero-lead { font-size: 16px; }
  .hero-facts { margin: 20px 0 17px; }
  .hero-facts span { font-size: 12px; margin-left: 4px; }
  .start-button { width: 100%; max-width: 380px; }
  .hero-art { width: 100%; max-width: 420px; height: 270px; margin: 0 auto; padding-bottom: 45px; }
  .character-card { gap: 12px; }
  .character-card img { width: 94px; height: 149px; }
  .character-middle img { width: 110px; height: 195px; }
  .character-hot img { height: 157px; }
  .character-card span { font-size: 12px; }
  .art-caption { font-size: 12px; }
  .how-section { padding: 22px 0; gap: 18px; }
  .how-steps { grid-template-columns: 1fr; gap: 19px; }
  .how-steps article { gap: 16px; }
  .step-number { min-width: 20px; }
  .how-steps h3 { margin-bottom: 4px; font-size: 16px; }
  .how-steps p { font-size: 14px; }
  .scope-note { margin-bottom: 24px; }
  .scope-note p { font-size: 13px; }
  .site-footer { gap: 7px 15px; padding: 20px 0 24px; }
  .site-footer > span:first-child { width: 100%; }
  .site-footer a { margin-left: 0; }
  .resume-box { flex-direction: column; align-items: flex-start; padding: 17px; gap: 15px; }
  .check-shell { padding-top: 20px; }
  .check-topline { margin-bottom: 16px; }
  .back-button, .muted-link { font-size: 12px; }
  .progress-label { font-size: 12px; }
  .progress-label b { font-size: 16px; }
  .question-layout { grid-template-columns: 1fr; gap: 20px; margin-top: 18px; }
  .question-aside { display: none; }
  .mini-illustration { margin: 0; flex-shrink: 0; }
  .mini-illustration img { display: block; width: 45px; height: 72px; }
  .question-aside p { font-size: 12px; }
  .question-period { font-size: 11px; margin: 0 0 0 auto; max-width: 92px; }
  .question-card h1 { font-size: 25px; margin: 9px 0; }
  .question-hint { font-size: 14px; }
  .answer-options { margin-top: 19px; }
  .answer-button { min-height: 69px; padding: 11px 12px; gap: 12px; }
  .answer-text { display: block; }
  .answer-text strong { display: block; font-size: 16px; }
  .answer-text small { display: block; font-size: 12px; margin-top: 2px; }
  .answer-skip { min-height: 56px; }
  .answer-skip strong { font-size: 14px; }
  .answer-skip .answer-text small { font-size: 11px; }
  .save-settings { justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 3px; margin-top: 22px; padding-top: 14px; }
  .results-shell { padding-top: 22px; }
  .result-heading { gap: 12px; padding-bottom: 22px; margin-bottom: 24px; }
  .result-heading h1 { font-size: 26px; }
  .result-heading > div > p:not(.eyebrow) { font-size: 14px; }
  .result-heading .eyebrow { font-size: 13px; }
  .result-date { display: block; margin: 4px 0 0; }
  .result-character { display: none; }
  .result-tags { gap: 5px 12px; font-size: 12px; }
  .result-tags span + span { padding-left: 0; border-left: 0; }
  .result-section-heading { gap: 12px; }
  .result-section-heading h2 { font-size: 22px; }
  .result-section-heading .text-link { font-size: 12px; gap: 5px; }
  .result-explainer { font-size: 14px; }
  .observed-summary { padding: 15px; gap: 9px; }
  .observed-summary > span { width: 100%; }
  .patterns-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .family-qi, .family-blood, .family-water { grid-column: auto; }
  .family-patterns, .family-blood .family-patterns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .family-heading { font-size: 14px; }
  .pattern-card { padding-top: 20px; padding-bottom: 14px; }
  .pattern-card-heading { flex-wrap: nowrap; }
  .pattern-status { text-align: right; }
  .pattern-card h4 small { display: inline-block; margin: 0 0 0 10px; }
  .pattern-plain { margin: 12px 0 10px; }
  .score-label { flex-direction: row; align-items: baseline; }
  .pattern-signals { min-height: 0; margin: 12px 0 4px; }
  .body-hints { margin-top: 28px; }
  .hint-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .body-hint { gap: 18px; padding: 19px 0; }
  .body-hint + .body-hint { border-top: 1px solid var(--line); }
  .body-hint img { width: 62px; height: 110px; }
  .body-hint h3 { font-size: 20px; }
  .memo-section { flex-direction: column; align-items: stretch; padding: 20px; gap: 22px; margin-top: 15px; }
  .memo-section h2 { font-size: 22px; }
  .memo-actions { min-width: 0; }
  .answers-review li > div { flex-direction: column; gap: 2px; }
  .result-bottom { flex-direction: column; align-items: stretch; gap: 13px; }
  .result-bottom .text-link { align-self: center; }
  .dialog-inner { padding: 0 20px 22px; }
  .dialog-heading { padding-top: 19px; gap: 14px; }
  .dialog-heading h2 { font-size: 21px; }
  .dialog-inner p { font-size: 14px; }
  .dialog-buttons { gap: 12px; }
  .dialog-buttons button { font-size: 13px; padding-inline: 15px; }
  .about-families article { gap: 14px; }
  .about-families h3 { font-size: 15px; }
  .reference-shell { margin-top: 28px; }
  .reference-shell h1 { font-size: 29px; }
  .reference-shell h2 { font-size: 23px; }
  .reference-shell p, .reference-shell li { font-size: 14px; }
  .method-box { padding: 18px; }
  .method-box h2 { font-size: 20px; }
  .method-table { font-size: 13px; }
  .method-table th, .method-table td { padding: 10px 8px; }
  .reference-card h3 { font-size: 17px; }
  .question-source-table { font-size: 12px; }
}

@media (max-width: 359px) {
  .section-shell, .site-header, .site-footer, .check-shell, .reference-shell { width: calc(100% - 32px); }
  .brand { font-size: 19px; }
  .hero h1 { font-size: 31px; }
  .hero-facts { column-gap: 5px; }
  .hero-facts span { margin-left: 0; }
  .question-card h1 { font-size: 23px; }
  .pattern-card h4 small { display: block; margin: 3px 0 0; }
  .result-section-heading { flex-wrap: wrap; gap: 5px; }
}

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

@media print {
  body { color: #111; background: white; font-size: 10pt; }
  .site-header, .site-footer, .result-character, .result-section-heading > .text-link, .pattern-details, .memo-section, .answers-review, .save-settings, .result-bottom, .storage-message, dialog, .skip-link { display: none !important; }
  main { min-height: 0; }
  .section-shell, .results-shell, .reference-shell { width: 100%; max-width: none; margin: 0; padding: 0; }
  .result-heading { padding: 0 0 12px; margin: 0 0 15px; }
  .result-heading h1 { font-size: 20pt; }
  .result-heading > div > p:not(.eyebrow), .result-tags, .result-explainer { font-size: 9pt; }
  .observed-summary { background: none; padding: 8px 12px; margin-bottom: 16px; }
  .patterns-grid { display: block; }
  .pattern-family { break-inside: avoid; margin-bottom: 16px; }
  .family-heading { font-size: 10pt; }
  .family-heading > span { font-size: 17pt; }
  .family-patterns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .family-blood .family-patterns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pattern-card { padding: 12px 0; break-inside: avoid; }
  .pattern-card h4 { font-size: 18pt; }
  .pattern-plain, .pattern-signals > span, .pattern-status, .range-footnote { font-size: 9pt; }
  .pattern-signals { min-height: 0; }
  .range-known { background: #777 !important; print-color-adjust: exact; }
  .range-unknown { background: repeating-linear-gradient(125deg,#bbb,#bbb 2px,white 2px,white 5px) !important; print-color-adjust: exact; }
  .body-hints { margin-top: 15px; }
  .body-hint { break-inside: avoid; padding: 12px 0; }
  .body-hint img { width: 55px; height: 85px; }
  .body-hint h3 { font-size: 12pt; }
  .body-hint p, .scope-note p { font-size: 8pt; }
  .scope-note { break-inside: avoid; padding: 10px 0; margin: 12px 0 !important; font-size: 9pt; }
  .print-only { display: block; break-before: page; }
  .print-only h2 { font-size: 16pt; }
  .print-only li { font-size: 9pt; margin-bottom: 5px; }
  .print-only p { font-size: 8pt; margin-top: 18px; }
  .reference-card { break-inside: avoid; }
  .reference-shell .primary-button { display: none; }
}

/* CMS iframe: intrinsic height; the CMS already displays the page title. */
body.is-embedded main{min-height:0}
body.is-embedded .site-header{min-height:72px}
body.is-embedded .brand b{display:none}
body.is-embedded .brand small{font:700 14px/1.7 var(--sans);color:var(--ink);margin:0}
