/* A welcoming naming notebook: warm paper, natural light and soft brown ink. */
:root {
  --ink: #43352f;
  --muted: #75695f;
  --blue: #8b5241;
  --blue-dark: #744131;
  --accent: #9a5c45;
  --line: #e3d9ce;
  --paper: #fffdf9;
  --surface: #ffffff;
  --pale: #f7eee8;
  --control: #805541;
  --control-hover: #6d4332;
  --soft-surface: #f8f2e9;
  --table-head: #f2e9de;
  --mint: #f2f2eb;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif CJK JP", serif;
}
body { background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.8; }
a { text-underline-offset: .25em; }
.wrap { max-width: 1240px; padding-left: 36px; padding-right: 36px; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.vibe-options input:focus-visible + span, .segmented input:focus-visible + span,
.gender-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The wordmark and plain tabs are the entire masthead. */
.site-header { height: auto; min-height: 90px; gap: 32px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.brand { font: 600 1.55rem/1.5 var(--serif); letter-spacing: .09em; color: var(--ink); white-space: nowrap; }
.view-tabs { align-self: stretch; align-items: center; padding: 0; background: none; border-radius: 0; gap: 22px !important; }
.view-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 13px 4px; min-height: 48px; color: var(--muted); font-size: .875rem; }
.view-tabs button:hover { color: var(--ink); background: transparent; }
.view-tabs button[aria-selected=true] { color: var(--ink); border-color: var(--accent); background: none; font-weight: 650; box-shadow: none; }
.view-tabs button > span { min-width: 19px; height: 19px; margin-left: 5px; border-radius: 3px; background: #eee5db; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.button { min-height: 44px; padding: 10px 19px; border-radius: 6px; font-size: .875rem; font-weight: 600; line-height: 1.6; box-shadow: none; }
.button.primary { background: var(--control); border-color: var(--control); color: #fff; box-shadow: none; }
.button.primary:hover { background: var(--control-hover); border-color: var(--control-hover); }
.button.secondary { color: var(--ink); background: transparent; border-color: #bebdb4; }
.button.secondary:hover { border-color: var(--ink); background: #f8f1e9; }
.button:disabled { opacity: .45; }
.text-button { color: var(--muted); font-size: .875rem; text-underline-offset: .25em; }
.eyebrow { color: var(--muted); }
.discovery-heading { display: grid; grid-template-columns: minmax(0,1fr) 264px; align-items: center; gap: 32px; padding: 26px 0 24px; }
.discovery-heading .heading-copy { display: block; min-width: 0; }
.discovery-heading .heading-copy h1 { font-weight: 500; }
.welcome-photo { display: block; width: 264px; height: 156px; object-fit: cover; object-position: center; border-radius: 6px; }
.discovery-heading h1, .intro h1 { margin: 0 0 10px; font: 600 2rem/1.5 var(--serif); letter-spacing: .05em; }
.discovery-heading p:not(.eyebrow), .intro-copy { margin: 0; font-size: 1rem; line-height: 1.8; color: var(--muted); }
.guide-inline { flex-shrink: 0; min-height: 44px; padding: 8px 0; border: 0; background: none; font-size: .875rem; color: var(--muted); text-decoration: underline; text-underline-offset: 5px; }
.guide-inline:hover { color: var(--accent); }

/* Search reads in order: group, surname, action, then optional preferences. */
.quick-surname { display: grid; grid-template-columns: minmax(250px,1.15fr) minmax(200px,1fr) auto; align-items: end; gap: 14px 28px; padding: 24px; border: 1px solid #e5d5c6; border-radius: 7px; background: var(--soft-surface); }
.gender-choice { grid-column: auto; gap: 0; margin: 0; }
.gender-choice legend, .surname-field label { font-size: .875rem; font-weight: 600; line-height: 1.6; margin: 0 0 9px; color: var(--ink); }
.gender-choice label > span { min-height: 48px; border: 1px solid #c5c3ba; border-right-width: 0; border-radius: 0; background: var(--surface); color: var(--ink); font-weight: 500; }
.gender-choice label:first-of-type > span { border-radius: 4px 0 0 4px; }
.gender-choice label:last-of-type > span { border-right-width: 1px; border-radius: 0 4px 4px 0; }
.gender-choice input:checked + span { background: var(--control); border-color: var(--control); color: #fff; box-shadow: none; }
.gender-choice input:hover:not(:checked) + span { background: #eee5db; }
.surname-field { min-width: 0; }
.surname-field label { display: flex; align-items: baseline; gap: 9px; }
.surname-field label > span { color: var(--muted); font-size: .75rem; font-weight: 400; }
.surname-field input { width: 100%; min-width: 0; min-height: 48px; padding: 9px 13px; background: var(--surface); color: var(--ink); border: 1px solid #bcbab0; border-radius: 4px; font: 1.15rem/1.5 var(--serif); }
.surname-field input::placeholder { color: #76736b; }
.quick-surname .surname-search { min-height: 48px; padding: 11px 28px; font-size: .9375rem; }
.quick-surname > p:not(.field-error) { font-size: .8125rem; line-height: 1.7; color: var(--muted); }
.quick-surname .field-error:empty { display: none; }
.quick-surname .surname-pending { color: var(--accent); font-size: .875rem; }
.search-settings { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 32px; }
.search-settings > summary { padding: 15px 0; min-height: 60px; gap: 10px 20px; color: var(--ink); background: transparent; }
.search-settings > summary:hover { background: var(--soft-surface); }
.search-settings > summary > strong { font-size: .875rem; font-weight: 600; }
.search-settings > summary > span { font-size: .8125rem; }
.search-settings > summary:after { font-weight: 400; color: var(--muted); }
.search-settings[open] > summary { border-bottom: 1px solid var(--line); }
.search-settings .discovery-form { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 24px 0 28px; gap: 24px 36px; border-radius: 0; background: transparent; box-shadow: none; }
.search-settings .preference-presets { padding-bottom: 6px; }
.search-settings #preference-presets { max-width: 640px; gap: 8px; }
.preference-presets > p:first-child { font-size: .875rem; font-weight: 600; margin-bottom: 12px; }
.preference-presets button, .stroke-presets button { min-height: 44px; border: 1px solid #c8c5bc; border-radius: 3px; background: var(--surface); color: var(--ink); font-size: .875rem; }
.preference-neutral button { border-color: transparent; background: transparent; color: var(--muted); }
.preference-presets button[aria-pressed=true], .stroke-presets button[aria-pressed=true] { background: var(--pale); border-color: var(--accent); color: #82362f; }
.preference-help { color: var(--muted); font-size: .875rem; line-height: 1.85; }
.search-settings .preference-section { border-color: var(--line); padding-top: 20px; }
.criterion-heading > label { font-size: 1rem; font-weight: 600; }
.discover-field input, .discover-field select, .criterion-heading select, #stroke-targets { background: var(--surface); border: 1px solid #c1bfb5; border-radius: 3px; color: var(--ink); }
.discover-field input, #stroke-targets { font-size: 1rem; }
.discover-field input::placeholder, .candidate-name::placeholder, .candidate-reading::placeholder, .memo-field textarea::placeholder { color: #76736b; }
.discover-field input::placeholder { font-size: 1rem; }
.vibe-options { gap: 8px; }
.vibe-options span { min-height: 42px; padding: 7px 13px; border: 1px solid #ccc9bf; border-radius: 3px; background: var(--surface); color: var(--ink); font-size: .875rem; }
.vibe-options input:checked + span { background: var(--pale); color: #82362f; border-color: var(--accent); }
#stroke-grids label { border-radius: 3px; font-size: .875rem; min-height: 42px; }
.inactive-preference { opacity: .65; }
.search-settings .more-preferences { grid-column: 1/-1; }
.search-settings .search-names { justify-self: start; }
.search-settings #clear-filters { justify-self: end; }

/* Four equal entry sections; opening one never changes another condition. */
#discovery-form .quick-surname { margin-bottom: 32px; }
.search-criteria { grid-column: 1/-1; min-width: 0; }
#search-criteria-title { margin: 4px 0; font-size: 1rem; font-weight: 600; }
#search-criteria-help { margin: 0 0 16px; font-size: .8125rem; line-height: 1.8; color: var(--muted); }
.search-criterion { margin: 10px 0 0; border: 1px solid #cfc7bc; border-radius: 6px; background: var(--surface); min-width: 0; }
.search-criterion > summary { display: grid; grid-template-columns: 115px minmax(0,1fr) 24px; align-items: center; gap: 10px 16px; min-height: 68px; padding: 16px 18px; cursor: pointer; list-style: none; border-radius: 6px; }
.search-criterion > summary::-webkit-details-marker { display: none; }
.search-criterion > summary::after { content: '＋'; font-size: 1.2rem; color: var(--muted); text-align: center; }
.search-criterion[open] > summary::after { content: '−'; }
.search-criterion > summary > strong { color: var(--ink); font-size: .9375rem; font-weight: 600; }
.search-criterion > summary > span { min-width: 0; font-size: .8125rem; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.search-criterion > summary > span[data-pending=true] { color: #944e2f; }
.search-criterion > summary:hover { background: #f5eee5; }
.search-criterion[open] > summary { border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; background: #f5eee5; }
.criterion-body { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 18px 28px; padding: 20px; }
.criterion-body-wide { display: block; }
.criterion-field-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 18px 28px; margin-top: 16px; }
.criterion-field-grid > .discover-field > label:not(.sr-only) { display: block; margin-bottom: 8px; }
.criterion-main { min-width: 0; }
.criterion-body .criterion-heading { flex-wrap: wrap; gap: 8px 12px; }
.criterion-body .criterion-heading > label { flex: 1 1 130px; font-size: .9375rem; }
.criterion-body .criterion-heading > select { flex: 0 1 150px; min-height: 44px; max-width: 100%; }
.criterion-body > .discover-field > label { min-height: 44px; display: flex; align-items: center; margin-bottom: 10px; }
.criterion-body .discover-field { margin-bottom: 0; }
.criterion-body .discover-field > select { margin-top: 8px; }
.criterion-body > .discover-field > select { margin-top: 0; }
.criterion-body .vibe-field { margin: 14px 0 0; }
.surname-balance-settings { grid-column: 1/-1; min-width: 0; border-top: 1px solid var(--line); }
.surname-balance-settings > summary { padding: 12px 0; min-height: 44px; cursor: pointer; font-size: .875rem; }
#balance-settings-summary { margin-left: 10px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.surname-balance-settings .extra-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: 18px 28px; }
#discovery-form #clear-filters { min-height: 44px; margin-left: auto; font-size: .875rem; }
@media (max-width: 640px) {
  .search-criterion > summary { grid-template-columns: minmax(0,1fr) 24px; gap: 3px 12px; padding: 13px 14px; }
  .search-criterion > summary > strong { grid-column: 1; grid-row: 1; }
  .search-criterion > summary > span { grid-column: 1; grid-row: 2; }
  .search-criterion > summary::after { grid-column: 2; grid-row: 1 / 3; }
  .criterion-body, .criterion-field-grid, .surname-balance-settings .extra-fields { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .criterion-body { padding: 16px; }
  .criterion-body > .discover-field > label { min-height: 0; margin-bottom: 6px; }
  #discovery-form #clear-filters { display: block; margin: 8px auto 0; }
}

/* Names take precedence over the table's controls and annotations. */
.discovery-results-heading { margin-bottom: 16px; gap: 20px; }
.discovery-results-heading h2, .board-heading h2 { font: 600 1.35rem/1.5 var(--serif); letter-spacing: .035em; }
.discovery-results-heading p { margin-top: 5px; font-size: .875rem; color: var(--muted); }
.results-controls { gap: 12px 20px; }
.results-sort label { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.results-sort select { border: 1px solid #c7c4bb; border-radius: 3px; background: var(--surface); color: var(--ink); min-height: 42px; font-size: .875rem; }
.result-pager { gap: 8px; }
.result-pager .button { padding: 8px 12px; min-height: 42px; font-size: .875rem; border-radius: 3px; }
.result-pager > span { min-width: 44px; font-size: .8125rem; color: var(--muted); }
.results-sort-help { margin: -4px 0 14px; color: var(--muted); font-size: .8125rem; line-height: 1.75; }
.results-sort-help:not(.sort-notice) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.active-preferences > span { background: #f3f1ec; color: var(--ink); border-color: var(--line); border-radius: 3px; font-size: .8125rem; }
.active-preferences:empty { display: none; }
.preference-trail { background: #f5f2ec; color: var(--ink); border: 0; border-left: 2px solid var(--accent); border-radius: 0; }
.preference-trail button { color: var(--accent); font-size: .875rem; }
.table-context { margin-bottom: 5px; color: var(--muted); font-size: .8125rem; line-height: 1.8; }
.table-context > strong { color: var(--ink); font-size: 1.05rem; }
.table-scroll-hint { color: var(--muted); font-size: .8125rem; margin-bottom: 12px; }
.results-table-scroll { border: 0; border-top: 1px solid #d5c2b1; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.results-table th, .results-table td { background: var(--surface); border-bottom-color: var(--line); padding-top: 13px; padding-bottom: 13px; }
.results-table thead th { background: var(--table-head); color: #59473c; border-bottom: 1px solid #d8c9b9; font-size: .875rem; font-weight: 600; padding-top: 13px; padding-bottom: 13px; }
.results-table thead th > small { color: var(--muted); font-size: .75rem; }
.results-table tbody tr:nth-child(even) > * { background: #fbfaf7; }
.results-table tbody tr:hover > * { background: #f5eee5; }
.results-table tbody tr.liked > * { background: #f8eeea; }
.results-table tr > :first-child { box-shadow: 1px 0 0 var(--line); padding-left: 18px; }
.table-name > strong { color: var(--ink); font-size: 1.5rem; font-weight: 600; letter-spacing: .07em; text-decoration-color: #c7c0b3; text-underline-offset: 5px; }
.table-name:hover > strong { color: var(--accent); text-decoration-color: var(--accent); }
.table-name > span { font-size: .8125rem; margin-top: 5px; letter-spacing: .025em; color: var(--muted); }
.table-meaning p { color: var(--ink); font-size: .875rem; line-height: 1.85; }
.table-meaning .table-wish { color: var(--muted); }
.results-table { min-width: 1150px; }
.results-table .col-name { width: 14%; }
.results-table .col-meaning { width: 23%; }
.results-table .col-match { width: 19%; }
.results-table .col-stroke { width: 6%; }
.results-table .col-actions { width: 14%; }
.table-match p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; line-height: 1.85; }
.table-match .match-positive, .table-match .match-exploration { color: var(--ink); }
.table-match .match-partial, .table-match .match-missed { color: var(--muted); }
.preference-trail > div { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.preference-trail button { min-height: 44px; }
.name-exploration { margin: 0 0 24px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.name-exploration h4, .preference-breakdown h4 { font-size: 1rem; font-weight: 600; margin: 0 0 12px; }
.exploration-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.exploration-choices button { text-align: left; padding: 12px; border: 1px solid #d5c2b1; border-radius: 5px; color: var(--ink); background: var(--soft-surface); line-height: 1.7; }
.exploration-choices button:hover { background: var(--pale); border-color: var(--accent); }
.exploration-choices strong { display: block; font: 500 1.125rem/1.7 var(--serif); }
.exploration-choices span { display: block; font-size: .875rem; }
.name-exploration > p { font-size: .8125rem; line-height: 1.8; color: var(--muted); margin-top: 10px; }
.preference-breakdown .criterion-matches { display: block; list-style: none; padding: 0; }
.preference-breakdown .criterion-matches li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; padding: 10px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.preference-breakdown .criterion-matches small { color: var(--muted); font-size: .8125rem; margin-left: 6px; font-weight: 400; }
.preference-breakdown .criterion-matches p { grid-column: 1/-1; font-size: .875rem; color: var(--muted); line-height: 1.8; margin: 0; }
.relaxation-options { display: grid; gap: 8px; max-width: 480px; margin: 18px auto; }
.relaxation-options button { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border: 1px solid #d5c2b1; border-radius: 5px; background: var(--soft-surface); color: var(--ink); font-size: .875rem; line-height: 1.7; text-align: left; }
.relaxation-options strong { white-space: nowrap; color: var(--accent); }
.relaxation-options button:hover { border-color: var(--accent); }
@media (max-width: 950px) {
  .results-table .col-name { width: 150px; }
  .results-table .col-meaning { width: 245px; }
  .results-table .col-match { width: 210px; }
  .results-table .col-stroke { width: 67px; }
  .results-table .col-actions { width: 170px; }
}
@media (max-width: 520px) {
  .exploration-choices { grid-template-columns: 1fr; }
  .exploration-choices button { display: flex; align-items: center; gap: 16px; padding: 10px 12px; }
  .exploration-choices strong { flex: 0 0 3em; }
}
.table-like { color: #777067; border-radius: 3px; }
.table-like[aria-pressed=true] { background: transparent; color: var(--accent); }
.table-add { border: 1px solid #bebbb0; border-radius: 3px; background: transparent; color: var(--ink); font-weight: 500; }
.table-add:disabled { background: #efeee8; border-color: var(--line); color: var(--muted); }
.table-footnote { font-size: .8125rem; line-height: 1.85; color: var(--muted); }
.results-floating-header { background: var(--table-head); box-shadow: 0 2px 0 #43352f12; }
.results-floating-header .results-table { min-width: 0; }
.result-pager-bottom { padding-top: 8px; margin-top: 18px; }
.shortlist-tray { background: #f5f2ed; border: 0; border-top: 1px solid #c7c1b6; border-radius: 0; padding: 22px 24px; }
.shortlist-tray strong { color: var(--ink); font-size: .875rem; }
.shortlist-tray .button { font-size: .875rem; }
.empty-suggestions { background: transparent; border: 1px solid var(--line); border-radius: 0; padding: 40px 22px; }
.discovery-source { margin-top: 30px; }
.discovery-source summary { font-size: .875rem; }

/* Comparison and name details retain a handwritten-note rhythm without cards inside cards. */
.intro { padding: 34px 0 26px; }
.settings-panel { background: var(--soft-surface); border: 1px solid #e5d5c6; border-radius: 7px; box-shadow: none; }
.settings-panel input, .segmented { border-color: #c8c5bc; border-radius: 3px; }
.segmented { background: #e9e7df; }
.segmented span { min-height: 42px; border-radius: 2px; font-size: .875rem; }
.field-help, .mode-setting .field-help, .mode-setting .field-help a { font-size: .8125rem; }
.candidate-grid { gap: 24px; }
.name-card { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid #aaa498; border-radius: 3px; box-shadow: none; }
.name-card.is-favorite { border-color: var(--accent); box-shadow: none; }
.card-top { padding-top: 12px; background: transparent; }
.card-index { color: var(--muted); font-size: .75rem; }
.candidate-name { font-family: var(--serif); font-weight: 600; color: var(--ink); letter-spacing: .05em; }
.name-card .candidate-reading, .name-card .full-name, .name-card .calculation > summary, .name-card .calc-table, .name-card .calc-note { font-size: .875rem; }
.name-card .result { padding: 0 22px; }
.total-row { background: #f3f1eb; border-radius: 3px; color: var(--ink); }
.memo-field { padding: 18px 22px 22px; border-top-color: var(--line); background: #faf8f3; }
.memo-label { color: var(--ink); font-size: .875rem; }
.memo-label span { color: var(--muted); font-size: .75rem; }
.memo-field textarea { background: transparent; padding: 6px 0 0; font-size: 1rem; line-height: 1.9; min-height: 94px; color: var(--ink); }
.board-foot p, .board-foot .text-button { font-size: .8125rem; }
.report-banner { background: transparent; color: var(--ink); border-top: 1px solid #d5c2b1; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 27px 0; margin-top: 36px; }
.report-banner > div { flex: 1; }
.report-banner h2 { font: 600 1.5rem/1.7 var(--serif); color: var(--ink); }
.report-banner p:not(.eyebrow) { color: var(--muted); font-size: .9375rem; }
.report-banner > .button { margin-left: 0; }
.method-grid article { border-color: var(--line); }
.method-grid h3 { font-size: 1rem; }
.method-grid p, .section-title > p:last-child, .details-body { font-size: 1rem; }
.section-title h2 { font-family: var(--serif); font-weight: 600; }
.source-details { background: transparent; border-radius: 0; border-color: var(--line); }
.source-details summary { font-size: .875rem; }
.suggestion-card { background: var(--surface); border-color: var(--line); border-radius: 3px; box-shadow: none; }
.suggestion-top { background: transparent; }
.suggestion-number { color: var(--muted); font-size: .75rem; }
.suggestion-name strong { font-family: var(--serif); color: var(--ink); font-weight: 600; }
.suggestion-reading { color: var(--muted); font-size: 1rem; }
.suggestion-reasons { font-size: .875rem; line-height: 1.9; }
.suggestion-tags span { border-radius: 2px; }
.suggestion-reactions button, .add-suggestion { border-radius: 3px; }
.suggestion-strokes .stroke-hit { border-color: var(--accent); }
.name-meaning, .criterion-matches li, .discovery-diagram { border-color: var(--line); }
.name-wish { background: #faf2e9; border-left: 2px solid var(--accent); border-radius: 0; }
.name-wish h4 { color: #754436; }
.kanji-meanings dt { color: var(--ink); }
.five-grid { border-color: var(--line); background: var(--surface); border-radius: 3px; }
.grid-selector > button, .grid-selector > div { background: #f4f2ed; border-color: #d3cec2; border-radius: 3px; color: var(--ink); }
.grid-selector > button[aria-pressed=true] { background: var(--pale); border-color: var(--accent); color: #82362f; }
.diagram-equation { background: #f4f2ed; color: var(--ink); border-radius: 3px; }
.diagram-heading > span, .diagram-note { font-size: .8125rem; }
.fortune-badge { border-radius: 2px; }
.manual-controls > p, .manual-edit button, .manual-reset { font-size: .875rem; }
dialog, .dialog-toolbar, .report-content { background: var(--surface); }
dialog::backdrop { background: #25231f80; backdrop-filter: blur(2px); }
#name-detail-dialog { border-color: #bcb7aa; border-radius: 7px; box-shadow: 0 20px 70px #24201926; }
.dialog-toolbar h2 { font-family: var(--serif); font-weight: 600; }
.dialog-actions .button { font-size: .875rem; }
.report-mode, .report-memo { border-radius: 3px; }
.report-footnotes { font-size: .75rem; }

/* A readable guide with a contents column and numbered text sections. */
.guide-hero { display: block; padding: 38px 0 34px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.guide-hero h1 { font: 600 2.1rem/1.6 var(--serif); letter-spacing: .045em; margin: 0 0 14px; }
.guide-hero p { max-width: 42em; font-size: 1rem; color: var(--muted); line-height: 1.95; }
.guide-meta { display: block; margin-top: 15px; color: var(--muted); font-size: .75rem; }
.guide-body { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 60px; align-items: start; }
.guide-toc { position: sticky; top: 24px; border-top: 2px solid var(--accent); padding-top: 16px; }
.guide-toc h2 { margin-bottom: 10px; font-size: .875rem; font-weight: 600; }
.guide-toc ol { list-style: none; margin: 0; padding: 0; }
.guide-toc a { display: block; min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .875rem; }
.guide-toc a:hover { color: var(--accent); }
.guide-article { min-width: 0; max-width: 820px; }
.guide-section { padding: 0 0 36px; margin: 0 0 36px; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.guide-section:last-child { border-bottom: 0; }
.guide-kicker { display: block; color: var(--accent); font: 500 .9375rem/1.5 var(--serif); margin-bottom: 12px; }
.guide-section h2 { font: 600 1.55rem/1.8 var(--serif); letter-spacing: .035em; margin: 0 0 18px; }
.guide-section > p { font-size: 1rem; line-height: 2.05; margin: 15px 0; color: var(--muted); }
.guide-section h3 { font-size: 1rem; line-height: 1.85; margin: 0 0 9px; font-weight: 650; color: var(--ink); }
.guide-note { background: #f4f1eb; border-left: 2px solid #b6a48e; border-radius: 0; padding: 20px 24px; margin: 24px 0; }
.guide-note p, .guide-note strong { font-size: 1rem; line-height: 2; color: #514c40; }
.guide-approaches { display: block; margin-top: 24px; }
.guide-approaches article { display: grid; grid-template-columns: 62px minmax(0,1fr); column-gap: 20px; padding: 23px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.guide-approaches article > span { grid-column: 1; grid-row: 1/4; padding-top: 2px; color: var(--accent); font-size: .8125rem; }
.guide-approaches article > h3, .guide-approaches article > p { grid-column: 2; }
.guide-approaches p { color: var(--muted); font-size: 1rem; line-height: 1.95; }
.guide-example { margin-top: 12px; color: #5f584b !important; font-size: .875rem !important; }
.guide-steps { padding: 0; margin: 24px 0; list-style: none; counter-reset: guide-step; }
.guide-steps li { counter-increment: guide-step; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 18px; margin: 25px 0; }
.guide-steps li::before { content: counter(guide-step,decimal-leading-zero); color: var(--accent); padding-top: 4px; font: 500 1rem/1.5 var(--serif); }
.guide-steps p { font-size: 1rem; color: var(--muted); line-height: 1.95; }
.guide-question { font-family: var(--serif); font-size: 1.25rem !important; color: var(--ink) !important; border-left: 2px solid var(--accent); padding: 6px 0 6px 20px; margin: 25px 0 !important; }
.guide-checks { margin: 22px 0; padding: 0; list-style: none; }
.guide-checks li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1rem; color: var(--muted); line-height: 1.95; }
.guide-checks li::before { content: '✓'; flex: 0 0 22px; color: var(--accent); font-size: .875rem; padding-top: 3px; }
.guide-links { display: flex; gap: 12px 22px; flex-wrap: wrap; margin: 20px 0; }
.guide-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; }
.guide-source-note { font-size: .875rem !important; }
.guide-cta { border-top: 2px solid var(--ink); padding: 26px 0; margin-bottom: 28px; }
.guide-cta h2 { font: 600 1.4rem/1.8 var(--serif); margin-bottom: 12px; }
.guide-cta p { color: var(--muted); font-size: 1rem; line-height: 1.9; margin-bottom: 22px; }
.guide-cta > div { display: flex; flex-wrap: wrap; gap: 12px; }
.site-footer { flex-wrap: wrap; gap: 10px 24px; margin-top: 42px; padding-top: 26px; padding-bottom: 26px; border-top: 1px solid var(--line); }
.footer-wordmark { font: 600 1.15rem/1.6 var(--serif); letter-spacing: .07em; color: var(--ink); }
.site-footer p { color: var(--muted); font-size: .8125rem; }
.footer-guide { background: none; border: 0; color: var(--muted); font-size: .875rem; padding: 8px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.site-footer .attribution { font-size: .75rem; line-height: 1.85; }
.site-footer .site-copyright { flex-basis: 100%; order: 1; color: var(--muted); font-size: .75rem; line-height: 1.85; }

@media (max-width: 1050px) {
  .wrap { padding-left: 28px; padding-right: 28px; }
  .quick-surname { gap: 14px 20px; grid-template-columns: minmax(230px,1.1fr) minmax(160px,1fr) auto; }
  .quick-surname .surname-search { padding-left: 20px; padding-right: 20px; }
  .guide-body { grid-template-columns: 185px minmax(0,1fr); gap: 34px; }
}
@media (max-width: 760px) {
  .wrap { padding-left: 22px; padding-right: 22px; }
  .site-header { min-height: 0; flex-wrap: wrap; gap: 6px; padding-top: 14px; padding-bottom: 0; }
  .brand { font-size: 1.5rem; }
  .view-tabs { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; gap: 8px !important; }
  .view-tabs button { min-height: 48px; padding: 11px 0; font-size: .875rem; line-height: 1.5; white-space: normal; }
  .discovery-heading { grid-template-columns: minmax(0,1fr) 148px; gap: 20px; padding: 24px 0 22px; }
  .welcome-photo { width: 148px; height: 112px; }
  .discovery-heading h1, .intro h1 { font-size: 1.7rem; margin-bottom: 8px; }
  .discovery-heading p:not(.eyebrow), .intro-copy { font-size: .9375rem; }
  .guide-inline { min-height: 40px; padding: 9px 0 0; font-size: .8125rem; }
  .quick-surname { grid-template-columns: minmax(0,1fr) auto; padding: 20px; gap: 14px 14px; }
  .gender-choice { grid-column: 1/-1; }
  .quick-surname .surname-search { padding: 11px 22px; }
  .quick-surname > p:not(.field-error) { font-size: .8125rem; }
  .search-settings { margin-bottom: 28px; }
  .search-settings > summary { padding: 14px 0; gap: 4px 12px; }
  .search-settings > summary > span { font-size: .75rem; }
  .search-settings .discovery-form { gap: 22px; }
  .discovery-results-heading { display: block; margin-bottom: 12px; }
  .discovery-results-heading > div:first-child { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
  .discovery-results-heading h2 { font-size: 1.25rem; }
  .discovery-results-heading p { font-size: .8125rem; }
  .results-controls { width: 100%; margin-top: 14px; justify-content: space-between; gap: 10px; }
  .results-sort { width: auto; flex: 1 1 180px; }
  .results-sort select { width: auto; flex: 1; }
  .results-controls .result-pager { display: none; }
  .result-pager .button { font-size: .8125rem; padding: 8px 10px; }
  .table-context { display: block; font-size: .8125rem; }
  .table-context > span { display: block; margin: 3px 0 0; }
  .table-name > strong { font-size: 1.4rem; }
  .results-table tr > :first-child { padding-left: 13px; }
  .table-scroll-hint, .table-footnote { font-size: .8125rem; }
  .shortlist-tray { padding: 20px; }
  .intro { padding: 25px 0 22px; }
  .candidate-grid { gap: 20px; }
  .segmented { flex-wrap: wrap; }
  .segmented label { white-space: normal; }
  .name-card .candidate-reading, .memo-field textarea, .unknown-entry input, .manual-edit input { font-size: 1rem; }
  .report-banner { padding: 23px 0; gap: 18px; }
  .report-banner > div { flex-basis: 100%; }
  .report-banner h2 { font-size: 1.35rem; }
  .method-grid p, .details-body { font-size: .9375rem; }
  .guide-hero { padding: 28px 0; margin-bottom: 24px; }
  .guide-hero h1 { font-size: 1.8rem; }
  .guide-body { display: block; }
  .guide-toc { position: static; margin-bottom: 34px; }
  .guide-toc ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .guide-section h2 { font-size: 1.4rem; }
  .guide-section { padding-bottom: 28px; margin-bottom: 30px; }
  .site-footer > p:not(.attribution) { font-size: .8125rem; }
}
@media (max-width: 520px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .view-tabs { gap: 3px !important; }
  .view-tabs button { font-size: .8125rem; }
  .discovery-heading { grid-template-columns: minmax(0,1fr) 104px; gap: 16px; }
  .discovery-heading h1 { font-size: 1.4rem; line-height: 1.65; letter-spacing: .025em; margin: 0; }
  .discovery-heading p:not(.eyebrow) { display: none; }
  .welcome-photo { width: 104px; height: 104px; object-position: center; }
  .quick-surname { padding: 18px 16px; }
  .quick-surname .surname-search { padding: 11px 18px; font-size: .875rem; }
  .gender-choice label > span { font-size: .875rem; }
  .search-settings > summary > span { max-width: none; }
  .search-settings .discovery-form { grid-template-columns: 1fr; padding: 22px 0; }
  .search-settings #clear-filters { justify-self: center; }
  .search-settings .search-names { width: 100%; }
  .search-settings .preference-section { grid-column: 1; }
  .search-settings .criterion-heading select { max-width: 145px; }
  .results-sort { flex-basis: 100%; }
  .table-name > strong { font-size: 1.35rem; }
  .name-card { display: block; }
  .name-card .result { padding: 0 18px; }
  .memo-field { padding-left: 18px; padding-right: 18px; }
  .memo-label span { display: none; }
  .surname-setting { grid-template-columns: 90px minmax(0,1fr); }
  .field-help, .save-setting .field-help, .mode-setting .field-help, .mode-setting .field-help a { font-size: .75rem; }
  .save-setting .button { font-size: .875rem; }
  .board-heading .button, .board-foot .text-button { font-size: .8125rem; }
  .guide-toc ol { display: block; }
  .guide-approaches article { grid-template-columns: 48px minmax(0,1fr); column-gap: 14px; }
  .guide-note { padding: 18px; }
  .guide-steps li { grid-template-columns: 28px minmax(0,1fr); gap: 14px; }
  .guide-cta > div > .button { width: 100%; }
  .site-footer .attribution { width: 100%; margin-left: 0; }
}
@media (max-width: 360px) {
  .discovery-heading { grid-template-columns: minmax(0,1fr) 80px; gap: 12px; }
  .discovery-heading h1 { font-size: 1.3rem; }
  .welcome-photo { width: 80px; height: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media print {
  body, .report-content { background: white; }
  .report-paper-header h2 { font-family: var(--serif); }
  .report-footnotes { font-size: 8pt; }
  .fortune-badge, .report-mode, .report-memo, .name-wish { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .guide-panel, .results-floating-header { display: none !important; }
}

/* A real HTML example: no script, catalogue fetch or notebook mutation required. */
.notebook-example { margin: 0 0 28px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: #f7f3ec; }
.notebook-example-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.notebook-example h2 { margin: 0; font: 600 1.25rem/1.6 var(--serif); }
.notebook-example-heading > span, .notebook-example-intro, .notebook-example-note { color: var(--muted); font-size: .8125rem; line-height: 1.8; }
.notebook-example-intro { margin: 8px 0 16px; }
.notebook-example-candidates { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.notebook-example-candidates article { padding: 16px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 4px; min-width: 0; }
.notebook-example h3 { margin: 0 0 4px; font: 600 1.5rem/1.5 var(--serif); }
.notebook-example h3 span { margin-left: 8px; color: var(--muted); font: 400 .875rem/1.6 var(--sans, sans-serif); }
.notebook-example-gloss { font-size: .8125rem; margin: 0 0 12px; color: var(--muted); }
.notebook-example dl { margin: 0; font-size: .8125rem; line-height: 1.8; }
.notebook-example dl > div + div { margin-top: 8px; }
.notebook-example dt { font-weight: 600; }
.notebook-example dd { margin: 0; }
.notebook-example-decision { margin: 16px 0 10px; font-size: .875rem; line-height: 1.9; }
.notebook-example-decision strong { margin-right: 6px; }
.notebook-example-note { margin: 8px 0 0; }
.notebook-example-note a { display: inline-block; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .notebook-example { padding: 16px; margin-bottom: 24px; }
  .notebook-example-candidates { grid-template-columns: minmax(0,1fr); gap: 10px; }
}
