:root {
  color-scheme: light;
  --paper: #f4f1ea; --surface: #fffdf8; --ink: #18211f; --muted: #68706d; --line: #cfd3cc;
  --accent: #d75832; --accent-dark: #9e331d; --focus: #135f64; --max: 1180px;
  --mo-consent-allow-bg: #2563eb; --mo-consent-allow-text: #fff; --mo-consent-allow-hover-bg: #1d4ed8;
  --mo-consent-deny-bg: #fff; --mo-consent-deny-text: #18211f; --mo-consent-deny-border: #6b7280; --mo-consent-focus-ring: #2563eb;
  font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, textarea { font: inherit; }
a { color: inherit; text-underline-offset: .22em; }
button { color: inherit; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 30; padding: .8rem 1rem; background: var(--ink); color: #fff; }
.skip-link:focus { top: 1rem; }
.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; }

.site-header { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; min-height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { display: flex; gap: .55rem; align-items: baseline; font-weight: 900; text-decoration: none; letter-spacing: -.04em; }
.wordmark span { color: var(--accent); font-size: .78rem; letter-spacing: .14em; }
.site-header nav { display: flex; gap: 1.5rem; font-size: .7rem; font-weight: 800; letter-spacing: .11em; }
.site-header nav a { text-decoration: none; }
.breadcrumbs { width: min(calc(100% - 40px), var(--max)); margin: 1rem auto 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; color: var(--muted); font-size: .68rem; letter-spacing: .08em; }
.breadcrumbs li + li::before { content: "/"; margin-right: .6rem; }

.hero { min-height: min(630px, calc(100vh - 88px)); width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: clamp(5rem, 12vw, 9rem) 0 6rem; position: relative; }
.eyebrow, .section-number, .practice-meta { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
.hero h1 { margin: .8rem 0 .7rem; max-width: 980px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(4.1rem, 11vw, 9rem); font-weight: 500; line-height: .96; letter-spacing: -.08em; }
.hero h1 span { display: inline-block; color: var(--accent); white-space: nowrap; }
.hero-lead { margin: 0 0 3.2rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.3rem); letter-spacing: .1em; }
.start-button { min-width: 210px; min-height: 58px; padding: 1rem 1.3rem; border: 1px solid var(--ink); background: var(--ink); color: #fff; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 800; letter-spacing: .16em; transition: background .16s ease, color .16s ease; }
.start-button:hover { background: transparent; color: var(--ink); }

.practice-shell { width: min(calc(100% - 40px), var(--max)); margin: 0 auto 6rem; padding: clamp(1.4rem, 4vw, 3rem); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 60px rgb(35 42 39 / .06); scroll-margin-top: 1rem; }
.practice-meta { display: grid; grid-template-columns: auto auto 1fr; gap: 1.5rem; align-items: start; }
.practice-meta > p { margin: .15rem 0; }
#practice-pack { color: var(--accent-dark); }
.live-stats { display: flex; justify-content: flex-end; gap: clamp(.8rem, 3vw, 2.5rem); text-align: right; }
.live-stats span { display: grid; gap: .25rem; }
.live-stats strong { color: var(--ink); font-size: 1rem; letter-spacing: 0; }
.prompt { margin: 3.2rem 0 1rem; color: var(--muted); font-size: .88rem; }
.target { margin: 0 0 2.4rem; max-width: 920px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(1.55rem, 4vw, 2.55rem); line-height: 1.75; letter-spacing: .03em; }
textarea { width: 100%; resize: vertical; min-height: 132px; padding: 1.2rem; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); font-size: 1.1rem; line-height: 1.7; }
textarea:disabled { background: #f1efe9; color: var(--muted); }
.input-note { margin: .8rem 0 0; color: var(--muted); font-size: .78rem; }
.shortcut-capture { min-height: 160px; border: 1px dashed var(--line); display: grid; place-content: center; gap: .7rem; text-align: center; background: #fff; }
.shortcut-capture span { color: var(--accent); font-size: .7rem; font-weight: 900; letter-spacing: .16em; }
.shortcut-capture strong { font-size: clamp(1.4rem, 4vw, 2.3rem); }

.result-panel { margin-top: 2.5rem; padding-top: 2.2rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: .7fr 1.3fr; gap: 2rem; }
.result-panel h3 { margin: .2rem 0 0; font-family: "Yu Mincho", serif; font-size: 2rem; font-weight: 500; }
.result-panel dl { margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); }
.result-panel dl div { background: var(--surface); padding: 1rem; }
.result-panel dt { color: var(--muted); font-size: .68rem; }
.result-panel dd { margin: .3rem 0 0; font-size: 1.25rem; font-weight: 900; }
.result-actions { grid-column: 2; display: flex; gap: .7rem; }
.result-actions button, .quiet-button { min-height: 44px; padding: .7rem 1.1rem; border: 1px solid var(--ink); background: transparent; cursor: pointer; font-weight: 800; letter-spacing: .08em; }
.result-actions button:last-child { background: var(--ink); color: #fff; }

.packs, .history { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: 6rem 0 7rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: .85fr 1.65fr; gap: clamp(2rem, 7vw, 7rem); }
.packs h2, .history h2, .about-grid h2 { margin: 1rem 0 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(2rem, 5vw, 4.3rem); font-weight: 500; line-height: 1.25; }
.pack-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.pack-grid button { min-height: 180px; padding: 1.5rem; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; display: grid; align-content: space-between; font-size: 1.25rem; font-weight: 900; letter-spacing: .04em; }
.pack-grid button:nth-child(odd) { border-right: 1px solid var(--line); }
.pack-grid button:hover { background: rgb(255 255 255 / .48); }
.pack-grid span { color: var(--accent); font-size: .72rem; }
.pack-grid small { color: var(--muted); font-size: .78rem; font-weight: 500; }
.history > div > p:last-child { color: var(--muted); line-height: 1.8; }
.history-card { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); }
.best { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 1.5rem; }
.best span { color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.best strong { font-family: "Yu Mincho", serif; font-size: 3rem; color: var(--accent); }
.history-card ol { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.history-card li { display: grid; grid-template-columns: 6rem 1fr auto; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line); font-size: .78rem; }
.history-card time { color: var(--muted); }

.about-grid { width: min(calc(100% - 40px), var(--max)); margin: 0 auto 7rem; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.about-grid article { min-height: 340px; padding: clamp(1.5rem, 4vw, 3.2rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid h2 { font-size: clamp(1.8rem, 4vw, 3.3rem); }
.about-grid article > p:last-child { color: var(--muted); line-height: 2; max-width: 45rem; }

.route-guide, .related-routes { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: 6rem 0 7rem; border-top: 1px solid var(--line); }
.route-guide > div:first-child { display: grid; grid-template-columns: .85fr 1.65fr; gap: clamp(2rem, 7vw, 7rem); align-items: end; margin-bottom: 3rem; }
.route-guide h2, .related-routes h2 { margin: 1rem 0 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(2rem, 5vw, 4.3rem); font-weight: 500; line-height: 1.25; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.guide-grid article { min-height: 220px; padding: clamp(1.3rem, 3vw, 2.2rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guide-grid h3 { margin: 0 0 1.2rem; font-size: 1rem; letter-spacing: .04em; }
.guide-grid p { margin: 0; color: var(--muted); line-height: 1.9; }
.related-routes > div { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 2.5rem; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.related-routes a { min-height: 140px; padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; align-content: center; gap: .7rem; text-decoration: none; }
.related-routes a:hover { background: rgb(255 255 255 / .48); }
.related-routes span { color: var(--muted); font-size: .82rem; }

.site-footer { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer-inner { display: grid; gap: 1.5rem; }
.creator-credit { width: fit-content; }
.analytics-privacy { max-width: 680px; }
.analytics-privacy summary { cursor: pointer; font-weight: 700; }
.analytics-privacy p { line-height: 1.7; }
.analytics-privacy button { min-height: 44px; border: 1px solid var(--line); background: transparent; padding: .6rem .9rem; cursor: pointer; }

.consent-banner { position: fixed; z-index: 20; left: 1rem; right: 1rem; bottom: 1rem; margin: auto; width: min(calc(100% - 2rem), 920px); padding: 1rem; background: #fff; border: 1px solid #9ca3af; box-shadow: 0 20px 70px rgb(0 0 0 / .18); display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.consent-banner p { margin: .35rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.consent-actions { display: flex; gap: .6rem; }
.consent-actions button { min-height: 44px; min-width: 116px; padding: .7rem 1rem; cursor: pointer; font-size: .88rem; font-weight: 800; }
.consent-actions [data-consent-allow] { border: 1px solid var(--mo-consent-allow-bg); background: var(--mo-consent-allow-bg); color: var(--mo-consent-allow-text); }
.consent-actions [data-consent-allow]:hover { background: var(--mo-consent-allow-hover-bg); }
.consent-actions [data-consent-deny] { border: 1px solid var(--mo-consent-deny-border); background: var(--mo-consent-deny-bg); color: var(--mo-consent-deny-text); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.consent-actions button:focus-visible { outline-color: var(--mo-consent-focus-ring); }

@media (max-width: 900px) {
  .site-header { align-items: flex-start; padding: 1.3rem 0; gap: 1rem; }
  .site-header nav { flex-wrap: wrap; justify-content: flex-end; }
  .practice-meta { grid-template-columns: 1fr auto; }
  .live-stats { grid-column: 1 / -1; justify-content: space-between; text-align: left; border-top: 1px solid var(--line); padding-top: 1rem; }
  .result-panel { grid-template-columns: 1fr; }
  .result-panel dl { grid-template-columns: repeat(3, 1fr); }
  .result-actions { grid-column: 1; }
}
@media (max-width: 760px) {
  .site-header { min-height: 72px; }
  .site-header nav { gap: .7rem 1rem; }
  .hero { min-height: 540px; padding-top: 6rem; }
  .hero h1 { font-size: clamp(3.6rem, 18vw, 6.5rem); }
  .packs, .history { grid-template-columns: 1fr; }
  .pack-grid { grid-template-columns: 1fr; }
  .pack-grid button:nth-child(odd) { border-right: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-grid article { min-height: 0; }
  .route-guide > div:first-child, .guide-grid, .related-routes > div { grid-template-columns: 1fr; }
  .guide-grid article { min-height: 0; }
  .consent-banner { grid-template-columns: 1fr; }
  .consent-actions { display: grid; }
  .consent-actions button { width: 100%; }
}
@media (max-width: 480px) {
  .site-header { display: grid; }
  .site-header nav { justify-content: flex-start; font-size: .65rem; }
  .live-stats { gap: .5rem; font-size: .55rem; }
  .live-stats strong { font-size: .8rem; }
  .result-panel dl { grid-template-columns: repeat(2, 1fr); }
  .history-card li { grid-template-columns: 1fr auto; }
  .history-card time { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .site-header, .hero, .practice-shell, .packs, .history, .about-grid, .route-guide, .related-routes, .site-footer, .breadcrumbs { width: min(calc(100% - 28px), var(--max)); }
  .hero h1 { font-size: 3.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (forced-colors: active) { .hero h1 span, .wordmark span { color: CanvasText; } }
