:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --paper-deep: #eae3d5;
  --ink: #2c2b29;
  --muted: #69645c;
  --line: #cfc6b7;
  --accent: #52665a;
  --accent-dark: #3f5147;
  --focus: #174d91;
  --error: #8a2f2f;
  --white: #fffdf8;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif;
  font-size: 100%;
  line-height: 1.75;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); overflow-x: hidden; }
body { min-width: 0; margin: 0; background: radial-gradient(circle at 50% 0, rgba(255,255,255,.72), transparent 42rem), var(--paper); }
a { color: inherit; text-underline-offset: .25em; }
button, input, textarea { font: inherit; color: inherit; }
button, input[type="radio"] { cursor: pointer; }
button, input, textarea { max-width: 100%; }
button, input[type="text"], input[type="date"], textarea { min-height: 48px; }
button { border: 1px solid var(--accent); border-radius: .25rem; background: var(--accent); color: var(--white); padding: .72rem 1.15rem; font-weight: 700; }
button:hover { background: var(--accent-dark); }
button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button.secondary:hover { background: rgba(255,255,255,.55); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 10; top: .5rem; left: .5rem; transform: translateY(-160%); padding: .55rem .8rem; background: var(--ink); color: #fff; }
.skip-link:focus { transform: translateY(0); }
.site-header, .site-footer { width: min(100% - 2rem, 70rem); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header { min-height: 4.5rem; border-bottom: 1px solid var(--line); }
.brand-return { font-family: system-ui, sans-serif; font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-decoration: none; }
.app-shell, .reading-shell { width: min(100% - 2rem, 42rem); margin-inline: auto; }
.hero { padding: clamp(3.4rem, 9vw, 7rem) 0 clamp(2.2rem, 6vw, 4.5rem); text-align: center; }
.eyebrow { margin: 0 0 .8rem; font-family: system-ui, sans-serif; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .2em; }
h1, h2, h3, legend { overflow-wrap: normal; word-break: normal; }
p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2.15rem, 8vw, 4.5rem); font-weight: 500; letter-spacing: .04em; line-height: 1.25; }
.hero h1 { font-size: min(clamp(2.15rem, 8vw, 4.25rem), calc((100vw - 2rem) / 5.2)); }
.title-chunk, .ui-phrase { display: inline-block; white-space: nowrap; }
.site-header a, .site-footer nav a, .copyright, .choice-button > span,
.step-actions button, .result-actions button { white-space: nowrap; }
.hero-copy { margin: 1.8rem auto 0; font-size: clamp(1rem, 2.5vw, 1.25rem); }
.chooser, .flow-form, .result { margin-bottom: clamp(4rem, 10vw, 8rem); }
.chooser h2, .flow-form legend, .flow-form h2, .result h2 { margin: 0 0 1.2rem; font-size: clamp(1.3rem, 4.5vw, 1.75rem); line-height: 1.45; font-weight: 600; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.choice-button { min-height: 8rem; display: flex; flex-direction: column; justify-content: center; gap: .4rem; text-align: left; background: var(--white); color: var(--ink); border-color: var(--line); padding: 1.4rem; }
.choice-button:hover { background: #fff; border-color: var(--accent); }
.choice-button span { font-size: 1.18rem; }
.choice-button small, .radio-card small { display: block; color: var(--muted); font-weight: 400; }
.privacy-note { margin-top: 1.2rem; color: var(--muted); font-size: .9rem; text-align: center; }
.flow-form { padding-top: 2rem; }
.flow-form [data-step], .result { scroll-margin-top: 2rem; }
.flow-form fieldset, .nested-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.flow-form label:not(.radio-card) { display: block; margin: 1rem 0 .35rem; font-weight: 600; }
.flow-form input[type="text"], .flow-form input[type="date"], .flow-form textarea, .result textarea { width: 100%; border: 1px solid var(--line); border-radius: .25rem; background: var(--white); padding: .8rem .9rem; }
textarea { resize: vertical; }
.field-help { margin: -.5rem 0 1.2rem; color: var(--muted); font-size: .92rem; }
.field-error { min-height: 1.7em; margin: .25rem 0; color: var(--error); font-family: system-ui, sans-serif; font-size: .88rem; font-weight: 600; }
.radio-card { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .8rem; margin: .75rem 0; padding: 1rem; border: 1px solid var(--line); background: rgba(255,253,248,.65); }
.radio-card input { margin-top: .4rem; }
.radio-list { display: grid; gap: .55rem; }
.radio-list label { min-height: 48px; display: flex !important; align-items: center; gap: .65rem; margin: 0 !important; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
input[type="radio"] { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.step-actions, .result-actions { display: flex; justify-content: space-between; gap: .8rem; margin-top: 2rem; }
.result { padding-top: 2rem; }
.result textarea { min-height: 14rem; }
.live-status { min-height: 1.75rem; font-family: system-ui, sans-serif; font-size: .9rem; }
.check-note { margin-top: 2rem; padding: 1rem 1.15rem; border-left: 3px solid var(--accent); background: rgba(255,255,255,.45); }
.check-note h3 { margin: 0; font-size: 1rem; }
.check-note p { margin: .35rem 0 0; color: var(--muted); }
.context-link { display: inline-block; margin-top: 2rem; font-weight: 700; }
.noscript-note { padding: 1rem; border: 1px solid var(--line); }
.site-footer { min-height: 8rem; padding-block: 1.75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.footer-note { min-width: 0; }
.footer-note p { margin: 0 0 .5rem; }
.copyright { font-size: .8rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.reading-shell { padding: clamp(3rem, 8vw, 6rem) 0; }
.reading-shell h1 { max-width: 11em; font-size: clamp(2rem, 7vw, 3.6rem); }
.reading-shell .about-title { max-width: none; font-size: min(clamp(2rem, 7vw, 3.6rem), calc((100vw - 2rem) / 8.4)); }
.about-title-line { display: block; white-space: nowrap; }
.reading-shell .lead { margin: 2rem 0 4rem; font-size: 1.15rem; }
.reading-shell section { margin: 3.2rem 0; }
.reading-shell h2 { font-size: 1.35rem; }
.creator-box { margin: 4rem 0 2rem; padding: 1.3rem; border: 1px solid var(--line); }
.creator-box p { margin: 0 0 .25rem; color: var(--muted); font-size: .85rem; }
.creator-box a { font-weight: 700; }
.primary-link { display: inline-flex; min-height: 48px; align-items: center; padding: .65rem 1rem; background: var(--accent); color: #fff; text-decoration: none; }

@media (max-width: 34rem) {
  .choice-grid { grid-template-columns: 1fr; }
  .choice-button { min-height: 6.5rem; }
  .site-header, .site-footer { width: min(100% - 1.25rem, 70rem); }
  .app-shell, .reading-shell { width: min(100% - 1.25rem, 42rem); }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; }
  .step-actions, .result-actions { align-items: stretch; flex-direction: column-reverse; }
  .step-actions button, .result-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (prefers-contrast: more) {
  :root { --line: #655f55; --muted: #45413b; }
}
:root {
  --mo-consent-background: #f4f0e7;
  --mo-consent-foreground: #393932;
  --mo-consent-border: #b9b5aa;
  --mo-consent-focus: #393932;
  --mo-consent-radius: 4px;
  --mo-consent-spacing: 16px;
}
#analytics-consent .market-observer-consent-banner { font-size: .8rem; }
.footer-note .market-observer-consent-change { display: block; margin-top: .6rem; font-size: .8rem; }
