@charset "UTF-8";

:root {
  color-scheme: light;
  --ink: #142e3c;
  --body: #253d49;
  --muted: #52636b;
  --paper: #fcfbf7;
  --line: #d5dcda;
  --navy: #142e3c;
  --orange: #98471f;
  --orange-soft: #f6ede3;
  --blue: #235d8c;
  --blue-soft: #edf3f7;
  --green: #286652;
  --accent: var(--navy);
  --soft: #edf1f2;
  font-family: Meiryo, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 90px; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--body); font-size: 18px; line-height: 1.95; overflow-wrap: break-word; }
a { color: var(--accent); text-underline-offset: .24em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a, summary, button { touch-action: manipulation; }
button { font: inherit; }
:focus-visible { outline: 3px solid #387ba6; outline-offset: 4px; }
section[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4, strong, b { color: var(--ink); }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.6; }
h1 { font-size: 64px; line-height: 1.3; letter-spacing: .02em; }
h2 { font-size: 30px; }
h3 { font-size: 28px; }
h4, .subheading { font-size: 23px; }
p + p { margin-top: 18px; }
ol { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
.wide { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.reading { width: min(840px, calc(100% - 64px)); margin-inline: auto; }
.reading-inset { width: min(840px, 100%); margin-inline: auto; }
.keep { white-space: nowrap; }
.note { color: var(--muted); font-size: 16px; line-height: 1.9; }
.important { padding-left: 20px; border-left: 3px solid var(--accent); }
.important .note { display: block; margin-top: 5px; }
.section-label { color: var(--accent); font-size: 16px; font-weight: 700; margin-bottom: 7px; }
.vertical-only { display: none; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 20px; color: #fff; background: var(--navy); }
.skip-link:focus { top: 8px; }

/* Navigation stays separate from the document's original hierarchy. */
.topbar { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar-inner { position: relative; display: flex; align-items: center; gap: 24px; width: min(1200px, calc(100% - 40px)); height: 66px; margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 24px; color: var(--ink); font-size: 18px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 16px; font-weight: 400; }
.chapter-now { margin-left: auto; color: var(--muted); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contents { flex-shrink: 0; margin-left: auto; }
.chapter-now + .contents { margin-left: 0; }
.contents summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 10px; color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer; list-style: none; }
.contents summary::-webkit-details-marker { display: none; }
.menu-icon { width: 18px; height: 12px; border-block: 1px solid currentColor; }
.contents nav { position: absolute; right: 0; top: calc(100% + 1px); width: min(390px, 100%); max-height: calc(100dvh - 86px); overflow-y: auto; padding: 12px 22px; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 12px 24px #142e3c12; }
.contents nav a { display: block; padding: 11px 0; font-size: 16px; color: var(--body); line-height: 1.8; text-decoration: none; }
.contents nav a + a { border-top: 1px solid var(--line); }
.contents nav a:hover, .contents nav a[aria-current="location"] { color: var(--orange); font-weight: 700; }

/* Keep the requested large ranking; no decorative copy around it. */
.opening { padding-top: 42px; padding-bottom: 58px; }
.ranking { margin-top: 24px; padding: 26px 28px 18px; background: var(--navy); color: #d8e3e8; }
.ranking-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.ranking-heading h2 { color: #fff; font-size: 20px; font-weight: 500; }
.ranking-heading p { font-size: 16px; }
.ranking-scale { display: flex; align-items: center; gap: 15px; margin: 26px 0 14px; font-size: 14px; color: #c4d7e0; }
.scale-line { position: relative; height: 1px; flex: 1; background: #a4bcc5; }
.scale-line::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border-top: 1px solid #a4bcc5; border-right: 1px solid #a4bcc5; transform: rotate(45deg); }
.ranking-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) 1.15fr; list-style: none; }
.ranking-list li { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 132px; padding: 12px 6px; }
.rank-type { color: #c4d7e0; font-size: 14px; white-space: nowrap; }
.ranking-list strong { color: #fff; font-size: 32px; line-height: 1.7; letter-spacing: -.04em; white-space: nowrap; }
.rank-connector { position: absolute; z-index: 1; right: -8px; top: 53%; color: #9fbbc8; font-size: 18px; line-height: 1; }
.rank-connector.major { right: -13px; color: #e9c7a3; font-size: 27px; }
.ranking-list .rank-mentsu { margin-left: 18px; background: #dce9dc; }
.rank-mentsu .rank-type, .rank-mentsu strong { color: #203e35; }
.rank-mentsu strong { font-size: 40px; }
.base-notes { margin-top: 34px; }
.base-notes p + p { margin-top: 22px; }

/* The source order is the page order, at every screen size. */
.reversal-group { --accent: var(--orange); --soft: var(--orange-soft); }
.group-title { padding-top: 34px; padding-bottom: 22px; border-top: 2px solid var(--orange); color: var(--ink); font-size: 30px; }
.chapter { padding-top: 42px; padding-bottom: 48px; }
.chapter + .chapter, .reversal-group + .chapter, .reversal-group ~ .chapter { border-top: 1px solid var(--line); }
.reversal { --accent: var(--orange); --soft: var(--orange-soft); }
.shapes { --accent: var(--blue); --soft: var(--blue-soft); }
.closing { --accent: var(--green); }
.chapter-header { margin-bottom: 24px; padding-left: 20px; border-left: 4px solid var(--accent); }
.chapter-header h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .3em; font-size: 32px; }
.compare-sign { color: var(--accent); }
.chapter-header .section-label { margin: 0 0 5px; }
.example { margin-top: 30px; }
.example + .example { margin-top: 38px; }
.example h4, .example .subheading { margin-bottom: 18px; }
.hand { margin: 24px 0 22px; }
.image-zoom { display: block; width: fit-content; max-width: 100%; color: var(--muted); cursor: zoom-in; text-decoration: none; }
.hand:not(.diagram) .image-zoom { width: min(100%, 720px); }
.hand:not(.diagram) img { width: 100%; }
.image-zoom img { height: auto; }
.zoom-hint { display: block; width: fit-content; margin: 7px 0 0 auto; font-size: 16px; line-height: 1.8; }
.image-zoom:hover .zoom-hint { text-decoration: underline; }
.diagram img { width: auto; background: #fff; }
.conclusion { padding: 15px 20px; border-left: 3px solid var(--accent); background: var(--soft); font-size: 18px; }
.conclusion strong { color: var(--accent); }
.shape-order { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 18px 0; border-block: 1px solid #abc1cf; margin: 22px 0 24px; font-size: 21px; }
.shape-order span, .shape-order strong { white-space: nowrap; }
.shape-order b, .shape-order strong { color: var(--accent); }
.number-scale { display: grid; list-style: none; border-block: 1px solid #aec2d0; margin: 24px 0 22px; }
.number-scale.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.number-scale.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.number-scale li { position: relative; display: flex; justify-content: center; align-items: center; min-height: 84px; padding: 14px 6px; }
.number-scale li:not(:last-child)::after { position: absolute; z-index: 1; right: -8px; top: 28px; content: "＜"; color: var(--blue); font-size: 18px; line-height: 1.5; }
.numerals { font-family: "Segoe UI", Arial, sans-serif; font-size: 29px; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; color: #536574; }
.numerals b { font-weight: 750; color: var(--accent); text-decoration: underline; text-decoration-color: #bad1df; text-underline-offset: .15em; }
.baseline { background: var(--blue-soft); }
.comparison-paragraph { margin-top: 38px; }
.resource-links { margin-top: 30px; }
.video-link { display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%; min-height: 48px; padding-block: 10px; font-size: 18px; line-height: 1.8; }
.youtube-icon { width: 27px; height: 20px; flex: 0 0 27px; }
.youtube-icon rect { fill: #e10000; }
.youtube-icon path { fill: #fff; }
.app-resource { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-weight: 700; }
.return-link { display: inline-block; min-height: 44px; margin-top: 24px; padding-block: 8px; }
.footer { padding-block: 28px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.footer p + p { margin-top: 6px; }

/* The original image is still directly accessible without JavaScript. */
body.has-dialog { overflow: hidden; }
.image-dialog { width: min(1080px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 0; background: var(--paper); color: var(--body); }
.image-dialog::backdrop { background: #10232edb; }
.dialog-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.dialog-bar p { color: var(--ink); font-size: 18px; font-weight: 700; }
.dialog-bar button { min-width: 88px; min-height: 46px; padding: 5px 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-size: 16px; }
.dialog-bar .zoom-toggle { margin-left: auto; }
.dialog-image-wrap { display: flex; justify-content: center; align-items: center; padding: 24px; min-height: 160px; }
.dialog-image-wrap img { width: auto; max-width: 100%; max-height: 65dvh; object-fit: contain; }
.dialog-image-wrap.is-magnified { display: block; overflow: auto; max-height: 65dvh; }
.dialog-image-wrap.is-magnified img { max-width: none; max-height: none; margin-inline: auto; }
.dialog-caption { padding: 0 24px 24px; font-size: 16px; line-height: 1.8; }

@media (max-width: 900px) {
  .horizontal-only { display: none; }
  .vertical-only { display: inline; }
  .ranking { position: relative; padding: 24px 28px 20px; }
  .ranking-scale { position: absolute; top: 100px; bottom: 45px; right: 30px; flex-direction: column; margin: 0; font-size: 14px; }
  .scale-line { width: 1px; height: auto; }
  .scale-line::after { top: auto; bottom: 0; right: -3px; transform: rotate(135deg); }
  .ranking-list { display: flex; flex-direction: column; padding: 18px 68px 0 0; }
  .ranking-list li { display: grid; grid-template-columns: 64px 1fr; min-height: 63px; padding: 8px 0; }
  .ranking-list strong { font-size: 34px; line-height: 1.45; }
  .rank-connector { left: 66px; right: auto; top: auto; bottom: -9px; font-size: 16px; transform: rotate(-90deg); }
  .ranking-list .rank-taatsu { min-height: 77px; padding-top: 14px; }
  .rank-connector.major { right: auto; left: 66px; bottom: -10px; font-size: 24px; }
  .ranking-list .rank-mentsu { display: block; margin: 24px 0 0; padding: 12px 20px; }
  .rank-mentsu .rank-type { display: block; }
  .rank-mentsu strong { font-size: 42px; }
  .chapter-now { max-width: 12em; }
}

@media (max-width: 600px) {
  html { scroll-padding-top: 82px; }
  .wide, .reading { width: calc(100% - 36px); }
  .topbar-inner { width: calc(100% - 32px); height: 62px; gap: 12px; }
  .brand-sub, .chapter-now { display: none; }
  .chapter-now + .contents { margin-left: auto; }
  .contents summary { padding-inline: 4px; }
  .contents nav { padding-inline: 16px; }
  .opening { padding-block: 28px 38px; }
  h1 { font-size: 48px; }
  h2, .group-title { font-size: 27px; }
  h4, .subheading { font-size: 22px; }
  .section-label { font-size: 16px; }
  .ranking { padding: 20px 20px 18px; }
  .ranking-heading { display: block; }
  .ranking-heading h2 { font-size: 20px; }
  .ranking-heading p { margin-top: 2px; font-size: 16px; }
  .ranking-scale { top: 113px; right: 20px; bottom: 42px; }
  .ranking-list { padding-top: 22px; padding-right: 48px; }
  .ranking-list li { grid-template-columns: 52px 1fr; }
  .ranking-list strong { font-size: 32px; }
  .rank-connector, .rank-connector.major { left: 54px; }
  .ranking-list .rank-mentsu { padding-inline: 16px; }
  .rank-mentsu strong { font-size: 40px; }
  .base-notes { margin-top: 28px; }
  .base-notes p + p { margin-top: 20px; }
  .important { padding-left: 14px; }
  .group-title { padding-top: 28px; padding-bottom: 10px; }
  .chapter { padding-block: 30px 36px; }
  .chapter-header { padding-left: 14px; margin-bottom: 24px; }
  .chapter-header h3 { font-size: 26px; column-gap: .22em; }
  .example { margin-top: 26px; }
  .example + .example { margin-top: 32px; }
  .example h4, .example .subheading { margin-bottom: 16px; }
  .hand { margin: 20px 0; }
  .conclusion { padding: 13px 16px; }
  .shape-order { display: grid; grid-template-columns: 1fr; gap: 3px; font-size: 21px; padding: 14px 0; }
  .shape-order b { width: fit-content; margin-left: 30px; transform: rotate(-90deg); font-size: 20px; line-height: 1.4; }
  .number-scale.seven { grid-template-columns: 1fr; border-top: 0; }
  .number-scale.seven li { justify-content: flex-start; min-height: 55px; padding: 8px 22px; border-top: 1px solid #d9e2e8; }
  .number-scale.seven li:first-child { border-color: #aec2d0; }
  .number-scale.seven li::after { top: auto; bottom: -12px; right: 24px; transform: rotate(-90deg); }
  .number-scale.four li { min-height: 78px; }
  .number-scale.four .numerals { font-size: 28px; }
  .number-scale.four li::after { top: 25px; font-size: 16px; }
  .video-link { gap: 12px; }
  .dialog-bar { padding: 10px 12px; }
  .dialog-bar p { flex: 1 1 100%; }
  .dialog-bar .zoom-toggle { margin-left: 0; }
  .dialog-bar form { margin-left: auto; }
  .dialog-image-wrap { padding: 18px 10px; }
  .dialog-caption { padding: 0 16px 20px; }
}

@media (max-width: 360px) {
  .wide, .reading { width: calc(100% - 32px); }
  .chapter-header h3 { font-size: 24px; }
  .chapter-header { padding-left: 10px; }
  .ranking { padding-inline: 16px; }
  .ranking-list li { grid-template-columns: 48px 1fr; }
  .ranking-list strong { font-size: 29px; }
  .rank-connector, .rank-connector.major { left: 50px; }
  .rank-mentsu strong { font-size: 38px; }
  .ranking-scale { right: 16px; }
  .number-scale.four .numerals { font-size: 26px; }
}

@media print {
  @page { margin: 16mm; }
  html { scroll-padding-top: 0; }
  body { background: #fff; color: #222; font-size: 12pt; }
  .wide, .reading { width: 100%; }
  .topbar, .skip-link, .zoom-hint, .image-dialog, .return-link { display: none !important; }
  .opening { padding-top: 0; }
  .chapter { padding-block: 24px; }
  .chapter-header, .subheading, h4 { break-after: avoid; }
  .ranking, .hand, .conclusion { break-inside: avoid; }
  .ranking, .conclusion { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .footer { padding-block: 20px 0; }
}
