/* LuckyJ playbook: a printed strategy book with felt-table figures.
   Serif text on warm paper, vermilion rubrics (numerals, Rule labels, the gap), jade for LuckyJ's line,
   and every mahjong table set on felt. Pages: index.html (cover and contents), points.html (the book),
   ja.html (the Japanese edition, cover and book on one page) and honver.html (the personal guide). */

:root {
  --paper: #f4f0e6;
  --plate: #f9f6f1;
  --ink: #1e1a14;
  --ink-2: #4c473f;
  --muted: #68625a;
  --hair: #d6d0c4;
  --hair-2: #e2ddd2;
  --felt: #134834;
  --felt-deep: #0c2f22;
  --felt-table: #1f513e;
  --felt-line: #2f634e;
  --cream: #f4f0e6;
  --cream-2: #c3cbbf;
  --cream-3: #b0beb1;
  --jade: #006243;
  --jade-mark: #006743;
  --jade-felt: #8edbb8;
  --verm: #b23b20;
  --verm-mark: #e16a3e;
  --verm-felt: #f5a583;
  --verm-soft: #fbe3d8;
  --jade-soft: #dceee3;
  --highlight: #f3e5b0;
  --back: #d4a24c;
  --felt-bg: radial-gradient(120% 95% at 38% 42%, #1a5842 0%, var(--felt) 52%, #0f3c2b 100%);

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* The book grid: a margin column for numerals and rubrics, the text column, and a side column for
     evidence notes. Figures span all three. */
  --margin-w: 200px;
  --text-w: 640px;
  --side-w: 280px;
  --gutter: 48px;
  --book-w: calc(var(--margin-w) + var(--text-w) + var(--side-w) + 2 * var(--gutter));
  --page-pad: 32px;
  --head-h: 64px;

  --tile-size: 2.6em;

  /* Older names, kept so rules and inline styles written against the first design still resolve. */
  --line: var(--hair);
  --panel: var(--plate);
  --green: var(--jade);
  --red: var(--verm);
  --gold: #8a6420;
  --blue: #2c5f75;
  --soft-green: var(--jade-soft);
  --soft-red: var(--verm-soft);
  --soft-gold: #f5ecd3;
  --shadow: 0 18px 40px -24px rgba(30, 26, 20, 0.35);
}

html:lang(ja) {
  --serif: "Newsreader", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --sans: "Schibsted Grotesk", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
}

@font-face {
  font-family: "mahjongtile-clr";
  src: url("fonts/GL-MahjongTile-Clr.woff2") format("woff2");
}

@font-face {
  font-family: "mahjongtile-colr";
  src: url("fonts/GL-MahjongTile-COLRv1.woff2") format("woff2");
}

@font-face {
  font-family: "mahjongtile";
  src: url("fonts/GL-MahjongTile.otf") format("opentype");
}

* {
  box-sizing: border-box;
}

html {
  /* Anchors land just under the running head, which stays on screen. */
  scroll-padding-top: calc(var(--head-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

/* In-page links glide only once app.js has settled the page on its anchor. While the page loads,
   the browser goes back to a link's anchor after every change in layout; gliding there crosses most
   of the book, the settle cuts the glide short, and Chromium can then leave the screen blank until
   the reader scrolls. */
@media (prefers-reduced-motion: no-preference) {
  html.anchor-settled {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-optical-sizing: auto;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html:lang(ja) body {
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

a {
  color: var(--jade);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #00432e;
}

:focus-visible {
  outline: 2px solid var(--verm-mark);
  outline-offset: 2px;
}

p,
ul,
ol,
table,
figure {
  margin: 0;
}

b,
strong {
  font-weight: 600;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

html:lang(ja) :is(h1, h2, h3, h4, h5) {
  font-weight: 600;
  letter-spacing: 0;
  font-feature-settings: "palt";
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--plate);
  font-family: var(--sans);
  font-size: 15px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ labels, rubrics, buttons */

.kicker,
.eyebrow,
.side-title,
.panel-kicker,
.label {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

html:lang(ja) :is(.kicker, .eyebrow, .side-title, .panel-kicker, .label) {
  letter-spacing: 0.06em;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--felt);
  border-radius: 2px;
  background: var(--felt);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.button-link:hover {
  background: var(--felt-deep);
  color: var(--cream);
}

.button-link.on-felt {
  border-color: var(--cream);
  background: var(--cream);
  color: var(--felt);
}

.button-link.on-felt:hover {
  background: #fff;
  color: var(--felt-deep);
}

.button-link svg,
.text-link svg {
  flex: 0 0 auto;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--jade);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(0, 98, 67, 0.4);
  text-underline-offset: 5px;
}

.text-link.on-felt {
  color: var(--cream);
  text-decoration-color: rgba(244, 240, 230, 0.45);
}

.new-tag,
.guide-new-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin: 0;
  padding: 0 7px;
  border-radius: 2px;
  background: var(--verm);
  color: var(--plate);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ running head */

.running-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--head-h);
  padding: 0 max(var(--page-pad), calc((100% - var(--book-w)) / 2));
  border-bottom: 1px solid var(--hair);
  background: rgba(244, 240, 230, 0.95);
  color: var(--ink);
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 180ms ease,
    box-shadow 180ms ease;
  backdrop-filter: blur(10px);
}

.running-head.on-felt {
  border-bottom-color: rgba(244, 240, 230, 0.16);
  background: transparent;
  color: var(--cream);
  backdrop-filter: none;
}

.book-mark {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}

.book-mark:hover {
  color: inherit;
}

/* The mark is the favicon's tile: a felt-green back under an ivory face with a vermilion J. */
.book-mark svg {
  display: block;
  width: 21px;
  height: 28px;
}

.book-mark .mark-back {
  fill: var(--felt);
}

.book-mark .mark-face {
  fill: var(--plate);
}

.book-mark .mark-letter {
  fill: var(--verm);
}

/* On the felt a green back would vanish, so the tile shows a pale bone back instead. */
.on-felt .book-mark .mark-back {
  fill: var(--cream-2);
}

.book-title {
  font-family: var(--serif);
  font-size: 21px;
  font-style: italic;
  line-height: 1;
  white-space: nowrap;
}

html:lang(ja) .book-title {
  font-size: 17px;
  font-style: normal;
  font-weight: 600;
}

.edition-tag {
  flex: 0 0 auto;
  color: var(--verm);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.on-felt .edition-tag {
  color: var(--verm-felt);
}

.running-location {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 20px;
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14.5px;
  white-space: nowrap;
}

.running-location:empty {
  display: none;
}

.running-location::before {
  flex: 0 0 auto;
  width: 1px;
  height: 22px;
  background: var(--hair);
  content: "";
}

.running-location span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.on-felt .running-location {
  color: var(--cream-3);
}

.running-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.running-nav a,
.running-nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.running-nav a:hover,
.running-nav button:hover {
  color: var(--ink);
}

.running-nav [aria-current="page"],
.running-nav [aria-expanded="true"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--verm);
}

.on-felt .running-nav a,
.on-felt .running-nav button {
  color: var(--cream-2);
}

.on-felt .running-nav a:hover,
.on-felt .running-nav button:hover,
.on-felt .running-nav [aria-current="page"] {
  color: var(--cream);
}

.on-felt .running-nav [aria-current="page"],
.on-felt .running-nav [aria-expanded="true"] {
  box-shadow: inset 0 -2px 0 var(--verm-felt);
}

.running-nav .lang-link {
  min-height: 36px;
  margin-left: 10px;
  border: 1px solid var(--hair);
  border-radius: 2px;
  color: var(--ink);
  font-size: 14px;
}

.on-felt .running-nav .lang-link {
  border-color: rgba(244, 240, 230, 0.34);
  color: var(--cream);
}

.running-nav .lang-link[aria-current="page"] {
  box-shadow: none;
  background: var(--felt);
  border-color: var(--felt);
  color: var(--cream);
}

.contents-toggle svg {
  display: block;
}

.reading-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--hair-2);
  opacity: 0;
  transition: opacity 160ms ease;
}

.reading-progress span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--verm-mark);
}

.reading-progress.is-live {
  opacity: 1;
}

.on-felt .reading-progress {
  opacity: 0;
}

/* Phones and tablets: the head slides away while you read down and comes back when you scroll up. */
@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .running-head.can-touch-retract {
    will-change: transform;
  }

  .running-head.can-touch-retract.is-retracted {
    transform: translateY(-100%);
  }

  .running-head.can-touch-retract:focus-within {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .running-head {
    transition: none;
  }
}

/* The contents panel opens under the head from any page that holds the book. */
.contents-panel {
  position: fixed;
  top: calc(var(--head-h) + 8px);
  right: max(16px, calc((100vw - var(--book-w)) / 2));
  z-index: 45;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - var(--head-h) - 24px);
  padding: 20px 22px 16px;
  overflow-y: auto;
  border: 1px solid var(--hair);
  background: var(--plate);
  box-shadow: 0 24px 48px -24px rgba(30, 26, 20, 0.45);
}

.contents-panel[hidden] {
  display: none;
}

.contents-panel .label {
  margin: 14px 0 6px;
}

.contents-panel .label:first-child {
  margin-top: 0;
}

.contents-panel ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contents-panel a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  min-height: 40px;
  padding: 8px 6px;
  border-top: 1px solid var(--hair-2);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.3;
  text-decoration: none;
}

.contents-panel a:hover {
  background: rgba(30, 26, 20, 0.04);
}

.contents-panel a b {
  color: var(--verm);
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
}

.contents-panel a small {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}

.contents-panel a.is-active {
  background: var(--jade-soft);
}

.contents-panel a.is-active::after {
  display: none;
}

/* ------------------------------------------------------------------ page frame */

.layout {
  display: block;
}

.book {
  max-width: calc(var(--book-w) + 2 * var(--page-pad));
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.side,
.point-rail,
.point-rail-panel,
.tile-row {
  display: none;
}

/* Front-matter and end-matter sections sit on the book grid: kicker in the margin, text in the column. */
.section {
  display: grid;
  grid-template-columns: var(--margin-w) minmax(0, var(--text-w)) var(--side-w);
  column-gap: var(--gutter);
  align-items: start;
  padding: 112px 0 0;
}

.section > * {
  grid-column: 2;
}

.section > * + * {
  margin-top: 22px;
}

.section > .kicker {
  grid-row: 1 / span 2;
  grid-column: 1;
  margin-top: 0;
  padding-top: 14px;
}

.section > h2 {
  margin-top: 0;
  font-size: clamp(34px, 3.4vw, 46px);
  line-height: 1.06;
  text-wrap: balance;
}

.section > p {
  text-wrap: pretty;
}

.section > :is(.method-grid, .insight-grid, .rx-grid, .rx-ledger, .drill-list, .source-scope-card,
  .model-point-grid, .evidence-grid, .validation-grid, .audit-details, .teacher-grid) {
  grid-column: 2 / 4;
}

.section > .rule {
  grid-column: 2;
}

.concept-divider {
  padding-top: 128px;
}

.concept-divider > h2 {
  font-style: italic;
  font-weight: 400;
}

.concept-divider + .point {
  margin-top: -40px;
  border-top: 0;
}

/* ------------------------------------------------------------------ chapters (the numbered points) */

.point {
  display: grid;
  grid-template-columns: var(--margin-w) minmax(0, var(--text-w)) var(--side-w);
  column-gap: var(--gutter);
  align-items: start;
  margin-top: 120px;
  padding-top: 96px;
  border-top: 1px solid var(--hair);
}

.point-number {
  grid-row: 1;
  grid-column: 1;
  margin-top: 8px;
  color: var(--verm);
  font-family: var(--serif);
  font-size: 176px;
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.74;
  user-select: none;
}

html:lang(ja) .point-number {
  font-family: "Newsreader", var(--serif);
  letter-spacing: -0.04em;
}

.point-body {
  display: grid;
  grid-row: 1;
  grid-column: 2 / 4;
  grid-template-columns: minmax(0, var(--text-w)) var(--side-w);
  column-gap: var(--gutter);
  align-items: start;
  min-width: 0;
}

.point-body > * {
  grid-column: 1;
  min-width: 0;
  margin: 0;
}

.point-body > * + * {
  margin-top: 22px;
}

.chapter-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.point-body > .guide-new-tag {
  justify-self: start;
}

.point-body > .guide-new-tag + .chapter-kicker,
.point-body > .guide-new-tag + h3 {
  margin-top: 12px;
}

.point-body > .chapter-kicker + h3 {
  margin-top: 14px;
}

.point h3 {
  font-size: clamp(40px, 4.4vw, 66px);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.02;
  text-wrap: balance;
}

html:lang(ja) .point h3 {
  font-size: clamp(32px, 3.6vw, 50px);
  line-height: 1.18;
}

.point-body > p {
  text-wrap: pretty;
}

.point-body > h3 + p,
.point-body > .standfirst {
  font-size: 23px;
  line-height: 1.5;
}

html:lang(ja) .point-body > h3 + p,
html:lang(ja) .point-body > .standfirst {
  font-size: 19.5px;
  line-height: 1.85;
}

.point-body > h3 + p,
.point-body > .standfirst {
  margin-top: 26px;
}

/* Rubrics: Rule and Exception carry their label in the margin, the rule itself set large. */
.rule,
.exception {
  position: relative;
}

.rule {
  padding: 18px 0 24px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  font-size: 24px;
  font-weight: 450;
  line-height: 1.4;
  text-wrap: pretty;
}

html:lang(ja) .rule {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.8;
}

.point-body > .rule {
  margin-top: 48px;
}

.exception {
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1.62;
}

html:lang(ja) .exception {
  font-size: 16.5px;
  line-height: 1.9;
}

.point-body > .rule + .exception {
  margin-top: 24px;
}

.rule > strong:first-child,
.exception > strong:first-child {
  position: absolute;
  top: -2px;
  left: calc(-1 * (var(--margin-w) + var(--gutter)));
  width: var(--margin-w);
  padding-top: 16px;
  border-top: 2px solid var(--verm);
  color: var(--verm);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.exception > strong:first-child {
  top: 0;
  padding-top: 6px;
  border-top: 0;
  color: var(--ink-2);
}

html:lang(ja) .rule > strong:first-child,
html:lang(ja) .exception > strong:first-child {
  letter-spacing: 0.06em;
}

/* Evidence and basis notes hang in the side column beside the text they support. */
.evidence-note {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.52;
}

html:lang(ja) .evidence-note {
  font-size: 14px;
  line-height: 1.85;
}

:is(.evidence-note, .rx-basis) > b:first-child {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.point-body > .evidence-note {
  grid-column: 2;
  align-self: start;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}

.point-body > .rule + .exception + .evidence-note,
.point-body > .exception + .evidence-note {
  margin-top: 24px;
}

.point-body > :is(.chart, .evidence-grid, .safety-timing) {
  margin-top: 36px;
}

/* Replays span the whole book width, out into the margin column. */
.point-body > [data-example],
.point-body > [data-guide-examples] {
  grid-column: 1 / -1;
  margin-top: 96px;
  margin-left: calc(-1 * (var(--margin-w) + var(--gutter)));
}

.point-body > [data-example]:empty,
.point-body > [data-guide-examples]:empty {
  margin-top: 0;
}

.chapter-next {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--hair);
}

.chapter-next a {
  display: grid;
  justify-items: end;
  gap: 8px;
  max-width: 720px;
  color: var(--ink);
  text-align: right;
  text-decoration: none;
}

.chapter-next a:hover .chapter-next-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.chapter-next-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-next-title {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.15;
  text-wrap: balance;
}

.chapter-next-title i {
  margin-right: 0.35em;
  color: var(--verm);
  font-style: italic;
}

html:lang(ja) .chapter-next-title {
  font-size: 24px;
}

/* A section's own rules (pattern synthesis, case studies) use the same rubric. */
.section > .rule {
  margin-top: 40px;
}

.section > .rule + .rule {
  margin-top: 28px;
}

/* ------------------------------------------------------------------ front-matter blocks */

.source-scope-card {
  display: grid;
  gap: 14px;
  padding: 26px 28px;
  border: 1px solid var(--hair);
  background: var(--plate);
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.58;
}

.source-scope-card b {
  color: var(--ink);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gutter);
  counter-reset: none;
  border-top: 1px solid var(--hair);
}

.method-grid > div {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--hair);
}

.method-grid b {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

.method-grid p {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.55;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 36px;
  border-top: 1px solid var(--hair);
}

.insight-grid > div {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--hair);
}

.insight-grid h3 {
  font-size: 21px;
  line-height: 1.25;
  text-wrap: balance;
}

.insight-grid p {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
}

.drill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gutter);
  counter-reset: drill;
  border-top: 1px solid var(--hair);
}

.drill-list > div {
  display: grid;
  align-content: start;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 14px;
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--hair);
  counter-increment: drill;
}

.drill-list > div::before {
  grid-row: 1 / span 2;
  color: var(--verm);
  content: counter(drill);
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
  line-height: 1.05;
}

.drill-list h3 {
  font-size: 21px;
  line-height: 1.25;
}

.drill-list p {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.55;
}

.sources ul,
.method-list {
  display: grid;
  gap: 10px;
  padding-left: 1.1em;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.55;
}

.sources li::marker {
  color: var(--verm);
}

/* ------------------------------------------------------------------ charts and stat tiles */

.chart {
  display: grid;
  gap: 12px;
  padding: 22px 24px 20px;
  border: 1px solid var(--hair);
  background: var(--plate);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 34%) minmax(0, 1fr) 56px;
  align-items: center;
  gap: 14px;
}

.bar-row b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
}

.bar-track {
  position: relative;
  height: 16px;
  background: linear-gradient(90deg, var(--hair-2) 1px, transparent 1px) 0 0 / 25% 100%;
  box-shadow: inset 1px 0 0 var(--hair);
}

.bar-fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--jade-mark);
}

.bar-row span {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.evidence-grid,
.safety-timing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--hair);
}

.evidence-card,
.safety-timing-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 20px 20px 0;
  border-bottom: 1px solid var(--hair);
}

.evidence-card b,
.safety-timing-card b {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.evidence-card strong,
.safety-timing-card strong {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.evidence-card span,
.safety-timing-card span {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.4;
}

.evidence-card small,
.safety-timing-card small {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.45;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.metric {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 24px 24px 4px 0;
}

.metric b {
  font-family: var(--sans);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.metric span {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.4;
}

.metric small {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
}

/* ------------------------------------------------------------------ tab buttons */

.example-tab-list button,
.guide-frame-tabs button {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--hair);
  border-radius: 2px;
  background: var(--plate);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.1;
  text-align: left;
}

.example-tab-list button:hover,
.guide-frame-tabs button:hover {
  border-color: var(--muted);
}

.example-tab-list button.active,
.guide-frame-tabs button.active {
  border-color: var(--felt);
  background: var(--felt);
  color: var(--cream);
}

.example-head > span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.4;
  text-align: right;
}

.case-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
}

.case-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--jade);
  font-weight: 500;
}

.source-room {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--hair);
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.evidence-tier {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-top: 6px;
  margin-left: 8px;
  padding: 0 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--jade);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.evidence-tier.split_supported,
.evidence-tier.contested,
.evidence-tier.stress_test {
  color: var(--gold);
}

.evidence-tier.unsupported,
.evidence-tier.unverified {
  color: var(--verm);
}

/* ------------------------------------------------------------------ audit data */

.audit-details {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.audit-details > summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}

.audit-details > p {
  margin: 4px 0 18px;
  color: var(--ink-2);
  font-size: 16px;
}

.validation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 24px;
}

.validation-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--hair);
  background: var(--plate);
}

.validation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.validation-head b {
  color: var(--verm);
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  font-weight: 400;
}

.validation-head span,
.validation-head em {
  font-family: var(--sans);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.validation-head span {
  color: var(--muted);
}

.validation-head em {
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--jade);
}

.validation-card.contested .validation-head em {
  color: var(--gold);
}

.validation-card.review_only .validation-head em {
  color: var(--muted);
}

.validation-card h3 {
  font-size: 19px;
  line-height: 1.25;
}

.validation-card p,
.validation-card li {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
}

.validation-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.1em;
}

.validation-method-warning,
.validation-caveat {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}

.validation-example {
  padding: 8px 10px;
  border-left: 0;
  background: rgba(30, 26, 20, 0.04);
  font-size: 14px;
}

.validation-example strong {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
}

.engine-consensus {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 20px 22px;
  border: 1px solid var(--hair);
  background: var(--plate);
}

.engine-consensus h3 {
  font-size: 21px;
}

.engine-consensus p {
  color: var(--ink-2);
  font-size: 15.5px;
}

.consensus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 36px;
}

.consensus-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 13.5px;
}

.consensus-row a {
  color: var(--ink);
  text-decoration: none;
}

.consensus-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin: 18px 0 10px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.stat-strip span {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px 16px 12px 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.35;
}

.stat-strip b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}

.consensus-bar {
  position: relative;
  height: 12px;
  background: var(--hair-2);
}

.consensus-bar span {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--jade-mark);
}

/* ------------------------------------------------------------------ replays: tabs, felt figure, quiz */

.point-example-tabs {
  display: grid;
  gap: 26px;
}

.example-tab-head {
  display: grid;
  grid-template-columns: var(--margin-w) minmax(0, 1fr);
  column-gap: var(--gutter);
  row-gap: 18px;
  align-items: start;
}

.example-tab-head > .label {
  padding-top: 14px;
}

.example-tab-heading {
  display: grid;
  gap: 8px;
}

.example-tab-heading h4 {
  font-size: 38px;
  line-height: 1.05;
}

html:lang(ja) .example-tab-heading h4 {
  font-size: 30px;
  line-height: 1.3;
}

.example-tab-heading p {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
}

.example-tab-list {
  display: flex;
  flex-wrap: wrap;
  grid-column: 2;
  gap: 6px;
}

.example-tab-list button {
  min-width: 84px;
  min-height: 56px;
}

.example-tab-list button b {
  font-size: 16px;
  font-weight: 700;
}

.example-tab-list button span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.example-tab-list button.active span {
  color: var(--cream-2);
}

.example-tab-body {
  min-width: 0;
}

.point-example-card {
  display: grid;
  gap: 40px;
  min-width: 0;
}

.replay-figure {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
  align-items: start;
  gap: 44px;
  margin: 0;
  padding: 36px 40px 40px;
  border-radius: 4px;
  background: var(--felt-bg);
  color: var(--cream);
}

.replay-table {
  min-width: 0;
}

.replay-table .lucky-table-wrap {
  margin: 0;
}

.replay-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.replay-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.figure-label {
  color: var(--cream-3);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.replay-caption {
  margin: 0;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 23px;
  font-style: italic;
  line-height: 1.4;
  text-wrap: pretty;
}

html:lang(ja) .replay-caption {
  font-size: 19px;
  font-style: normal;
  line-height: 1.7;
}

.replay-caption .inline-tile,
.replay-quiz .inline-tile,
.quiz-result .inline-tile {
  font-size: 1.5em;
}

.replay-rule {
  height: 1px;
  background: var(--felt-line);
}

.replay-quiz {
  display: grid;
  gap: 14px;
}

.quiz-label {
  color: var(--verm-felt);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiz-prompt {
  color: var(--cream);
  font-size: 18.5px;
  line-height: 1.5;
}

html:lang(ja) .quiz-prompt {
  font-size: 16.5px;
  line-height: 1.8;
}

.quiz-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quiz-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 76px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 240, 230, 0.34);
  border-radius: 3px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  font-family: var(--sans);
  text-align: left;
}

.quiz-choice:hover {
  border-color: var(--cream);
}

.quiz-choice .tiles {
  flex: 0 0 auto;
  font-size: 48px;
}

.quiz-choice-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quiz-choice-action {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.2;
}

.quiz-choice-note {
  color: var(--cream-3);
  font-size: 13px;
  line-height: 1.3;
}

.quiz-choice[aria-pressed="true"] {
  border-color: var(--cream);
  background: var(--cream);
  color: var(--felt);
}

.quiz-choice[aria-pressed="true"] .quiz-choice-note {
  color: var(--felt-line);
}

.is-revealed .quiz-choice {
  cursor: default;
}

.quiz-owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.quiz-owner::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--jade-felt);
  content: "";
}

.quiz-owner.is-model::before {
  box-sizing: border-box;
  border: 1.5px solid var(--cream-2);
  background: transparent;
}

.quiz-choice[aria-pressed="true"] .quiz-owner.is-model::before {
  border-color: var(--felt-line);
}

.quiz-choice[aria-pressed="true"] .quiz-owner::before {
  background: var(--jade-mark);
}

.quiz-skip {
  justify-self: start;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cream-2);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: rgba(244, 240, 230, 0.4);
  text-underline-offset: 4px;
}

.quiz-skip:hover {
  color: var(--cream);
}

.replay-answer {
  display: grid;
  gap: 16px;
}

.replay-answer[hidden] {
  display: none;
}

.quiz-result {
  color: var(--cream);
  font-size: 18.5px;
  line-height: 1.5;
}

html:lang(ja) .quiz-result {
  font-size: 16.5px;
  line-height: 1.8;
}

.replay-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.replay-footer .evidence-tier {
  margin: 0;
  border-color: var(--felt-line);
  color: var(--jade-felt);
}

.replay-footer .evidence-tier.split_supported,
.replay-footer .evidence-tier.contested,
.replay-footer .evidence-tier.stress_test {
  color: var(--back);
}

.replay-footer .evidence-tier.unsupported,
.replay-footer .evidence-tier.unverified {
  color: var(--verm-felt);
}

.replay-footer button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(244, 240, 230, 0.34);
  border-radius: 2px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}

.hands-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(244, 240, 230, 0.34);
  border-radius: 2px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}

.hands-toggle::before {
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--cream-2);
  border-radius: 2px;
  content: "";
}

.hands-toggle[aria-pressed="true"]::before {
  border-color: var(--cream);
  background: var(--cream)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.2l2.6 2.6L11 4.4' fill='none' stroke='%23134834' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 14px 14px no-repeat;
}

/* The two lines, LuckyJ's against the model's, as cards on the felt. */
.replay-answer .comparison,
.replay-panel .comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.replay-panel .decision {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px 16px;
  border: 0;
  border-top: 3px solid var(--cream-2);
  background: rgba(12, 47, 34, 0.55);
  color: var(--cream);
}

.replay-panel .decision:first-child {
  border-top-color: var(--jade-felt);
}

.replay-panel .decision.decision-wide {
  grid-column: 1 / -1;
}

.replay-panel .decision b {
  color: var(--cream);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.replay-panel .decision:first-child b {
  color: var(--jade-felt);
}

.replay-panel .decision > span,
.replay-panel .decision > small,
.replay-panel .diagnostics > span,
.replay-panel .diagnostics > small {
  display: block;
  color: var(--cream-2);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.4;
}

.replay-panel .decision > .discard-line,
.replay-panel .decision > .call-action-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--cream);
  font-size: 16px;
  font-weight: 700;
}

.replay-panel .decision .discard-line em,
.replay-panel .decision .call-action-line em {
  color: var(--cream-3);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 500;
}

.replay-panel .decision .choice-weight {
  justify-self: start;
  margin: 2px 0;
  padding: 3px 6px;
  border: 1px solid var(--felt-line);
  color: var(--cream-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.replay-panel .diagnostics {
  margin-top: 4px;
  color: var(--cream-3);
  font-family: var(--sans);
  font-size: 12.5px;
}

.replay-panel .diagnostics summary {
  cursor: pointer;
  font-weight: 600;
}

.replay-panel .diagnostics span,
.replay-panel .diagnostics small {
  font-size: 12.5px;
}

.replay-panel .safety-read {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-top: 1px solid var(--felt-line);
  border-bottom: 1px solid var(--felt-line);
  color: var(--cream-2);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
}

.replay-panel .safety-read b {
  color: var(--cream);
}

.replay-panel .safety-read ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.replay-panel .call-line {
  display: grid;
  gap: 4px;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14.5px;
}

.replay-panel .call-line span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* Below the figure: the commentary on paper, labels in the margin, the Mortal check in the side column. */
.replay-notes {
  display: grid;
  grid-template-columns: var(--margin-w) minmax(0, var(--text-w)) var(--side-w);
  column-gap: var(--gutter);
  row-gap: 26px;
  align-items: start;
}

.replay-notes[hidden] {
  display: none;
}

.replay-notes > * {
  grid-column: 1 / 3;
  min-width: 0;
}

.replay-notes .natsu-analysis {
  display: contents;
}

.replay-notes .analysis-step {
  display: grid;
  grid-column: 1 / 3;
  grid-template-columns: var(--margin-w) minmax(0, var(--text-w));
  column-gap: var(--gutter);
  margin: 0;
}

.analysis-step h5 {
  padding-top: 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

html:lang(ja) .analysis-step h5 {
  letter-spacing: 0.06em;
}

.analysis-step p {
  font-size: 19.5px;
  line-height: 1.62;
  text-wrap: pretty;
}

html:lang(ja) .analysis-step p {
  font-size: 16.5px;
  line-height: 1.9;
}

.replay-notes .analysis-step:first-child h5 {
  color: var(--verm);
}

.replay-notes > .mortal-block {
  grid-row: 1 / span 2;
  grid-column: 3;
  align-self: start;
}

.replay-notes > .yaku-condition-read {
  display: grid;
  grid-column: 2 / 3;
}

.replay-notes > .case-links {
  grid-column: 2 / 3;
}

.yaku-condition-read {
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--hair);
  background: var(--plate);
}

.yaku-condition-read h5 {
  color: var(--verm);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.yaku-condition-threats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family: var(--sans);
  font-size: 13.5px;
}

.yaku-condition-threats > span {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.yaku-condition-threats em {
  font-style: normal;
}

.mortal-block {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.mortal-block .kicker {
  margin: 0;
  font-size: 11.5px;
}

.mortal-summary-line,
.mortal-branch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
}

.mortal-summary-line b,
.mortal-branch b {
  font-weight: 600;
}

.mortal-block .discard-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.model-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.model-badge.agree {
  background: var(--jade-soft);
  color: var(--jade);
}

.model-badge.split {
  background: var(--verm-soft);
  color: var(--verm);
}

.choice-weight {
  display: inline-block;
  font-family: var(--sans);
}

/* Decision cards on paper (case studies and the guide's older layouts). */
.comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.decision {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--hair);
  border-top: 3px solid var(--jade-mark);
  background: var(--paper);
}

.decision + .decision {
  border-top-color: var(--muted);
}

.decision b {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.decision > span,
.decision > small,
.diagnostics > span,
.diagnostics > small {
  display: block;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.45;
}

.decision > .discard-line,
.decision > .call-action-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.decision .discard-line em,
.decision .call-action-line em {
  color: var(--muted);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 500;
}

.decision .choice-weight {
  justify-self: start;
  padding: 2px 6px;
  border: 1px solid var(--hair);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.diagnostics summary {
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
}

.safety-read {
  display: grid;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13.5px;
}

.safety-read p {
  margin: 0;
}

.safety-read ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.safety-read li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
}

.call-line {
  display: grid;
  gap: 4px;
  font-family: var(--sans);
  font-size: 14px;
}

/* ------------------------------------------------------------------ prescriptions */

.rx-ledger {
  display: grid;
  margin-top: 40px;
  border-bottom: 1px solid var(--hair);
}

.rx-ledger-head,
.rx-ledger a {
  display: grid;
  grid-template-columns: 44px minmax(0, 280px) minmax(0, 1fr) 112px;
  column-gap: 24px;
  align-items: baseline;
}

.rx-ledger-head {
  padding-bottom: 12px;
}

.rx-ledger-head span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rx-ledger-head span:last-child {
  text-align: right;
}

.rx-ledger a {
  padding: 20px 0 22px;
  border-top: 1px solid var(--hair);
  color: var(--ink);
  text-decoration: none;
}

.rx-ledger a:hover .rx-ledger-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.rx-ledger-num {
  color: var(--verm);
  font-size: 30px;
  font-style: italic;
  line-height: 1;
}

.rx-ledger-title {
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
}

.rx-ledger-default {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.5;
  text-wrap: pretty;
}

html:lang(ja) .rx-ledger-default {
  font-size: 15.5px;
  line-height: 1.8;
}

.rx-ledger-see {
  color: var(--jade);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.rx-grid {
  display: grid;
  gap: 0;
  margin-top: 16px;
  counter-reset: rx;
}

/* Each prescription is a full-width switch: numeral in the margin, heading and lead first, then the
   figures and tables, basis notes in the side column. CSS order moves the heading above the figures. */
.rx-card {
  display: grid;
  grid-template-columns: var(--margin-w) minmax(0, var(--text-w)) var(--side-w);
  column-gap: var(--gutter);
  align-items: start;
  margin-left: calc(-1 * (var(--margin-w) + var(--gutter)));
  padding-top: 96px;
  counter-increment: rx;
}

.rx-card::before {
  grid-row: 1 / span 2;
  grid-column: 1;
  order: -3;
  color: var(--verm);
  content: counter(rx);
  font-family: var(--serif);
  font-size: 104px;
  font-style: italic;
  font-weight: 300;
  line-height: 0.8;
}

.rx-card > * {
  grid-column: 2;
  min-width: 0;
  margin: 0;
}

.rx-card > * + * {
  margin-top: 22px;
}

.rx-card > h3 {
  order: -2;
  margin-top: 0;
  font-size: clamp(32px, 3.2vw, 44px);
  line-height: 1.08;
  text-wrap: balance;
}

html:lang(ja) .rx-card > h3 {
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.3;
}

.rx-card > p.rx-rule:first-of-type {
  order: -1;
  margin-top: 18px;
  font-size: 20.5px;
  line-height: 1.55;
}

html:lang(ja) .rx-card > p.rx-rule:first-of-type {
  font-size: 17.5px;
  line-height: 1.9;
}

.rx-card .rx-rule {
  text-wrap: pretty;
}

/* The evidence sits in the side column, level with the lead, like a chapter's Evidence note. */
.rx-card > .rx-basis {
  grid-row: 2 / span 4;
  grid-column: 3;
  align-self: start;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
}

html:lang(ja) .rx-card > .rx-basis {
  font-size: 13.5px;
  line-height: 1.8;
}

.rx-card > .rx-basis + .rx-basis {
  margin-top: 14px;
}

.rx-card > .rx-except {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
  font-size: 18.5px;
  line-height: 1.55;
}

html:lang(ja) .rx-card > .rx-except {
  font-size: 16px;
  line-height: 1.9;
}

/* ------------------------------------------------------------------ corrections (book and guide) */

/* A corrected sentence is highlighted where it stands, and a Corrected tag points readers to it. */
mark.guide-changed {
  padding: 0 2px;
  background: var(--highlight);
  box-shadow: inset 0 -2px 0 #c9a13b;
  color: inherit;
  /* a corrected sentence lands with a few lines of its paragraph above it */
  scroll-margin-top: 96px;
}

.changed-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin: 0;
  padding: 0 7px;
  border-radius: 2px;
  background: var(--highlight);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ against the humans */

/* The section's evidence note hangs in the side column beside the three intro paragraphs. */
.section > .contrast-note {
  grid-row: 3 / span 3;
  grid-column: 3;
  align-self: start;
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}

.section > .contrast-figure {
  grid-column: 2 / 4;
  margin: 48px 0 0;
}

.contrast-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* Each panel is a small printed plate: one decision, three groups, two conditions. */
.contrast-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 18px 16px;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: var(--plate);
  --tc-tok: var(--muted);
  --tc-hou: var(--gold);
  --tc-lj: var(--jade-mark);
}

.contrast-panel p {
  margin: 0;
}

.contrast-panel-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.contrast-panel-sub {
  margin-bottom: 6px !important;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.4;
}

.dumbbell {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 62px;
  align-items: center;
  gap: 10px;
  height: 30px;
  font-family: var(--sans);
  font-size: 12.5px;
}

.dumbbell-who {
  color: var(--ink-2);
}

.dumbbell-change {
  color: var(--ink-2);
  text-align: right;
  white-space: nowrap;
}

.dumbbell.is-lj :is(.dumbbell-who, .dumbbell-change) {
  color: var(--jade);
  font-weight: 650;
}

.dumbbell-track {
  position: relative;
  height: 30px;
}

.dumbbell-track::before {
  position: absolute;
  top: 14px;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--hair);
  content: "";
}

.dumbbell-bar {
  position: absolute;
  top: 13px;
  height: 3px;
  border-radius: 2px;
}

.dumbbell-dot {
  position: absolute;
  top: 9px;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border: 2px solid;
  border-radius: 50%;
  background: var(--plate);
}

.dumbbell-bar.is-tok { background: var(--tc-tok); }
.dumbbell-bar.is-hou { background: var(--tc-hou); }
.dumbbell-bar.is-lj { background: var(--tc-lj); }
.dumbbell-dot.is-tok { border-color: var(--tc-tok); }
.dumbbell-dot.is-hou { border-color: var(--tc-hou); }
.dumbbell-dot.is-lj { border-color: var(--tc-lj); }
.dumbbell-dot.is-tok.is-end { background: var(--tc-tok); }
.dumbbell-dot.is-hou.is-end { background: var(--tc-hou); }
.dumbbell-dot.is-lj.is-end { background: var(--tc-lj); }

.contrast-panel-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-top: 4px !important;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}

.contrast-panel-key :is(.key-open, .key-filled) {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.contrast-panel-key .key-filled {
  margin-left: 8px;
  background: var(--muted);
}

.contrast-figure figcaption {
  max-width: var(--text-w);
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}

html:lang(ja) :is(.contrast-panel-title, .contrast-panel-sub, .dumbbell, .contrast-panel-key, .contrast-figure figcaption) {
  letter-spacing: 0.02em;
}

.section > .contrast-subhead {
  margin-top: 104px;
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
}

.section > .contrast-subhead + .insight-grid {
  margin-top: 18px;
}

@media (max-width: 1023px) {
  .section > .contrast-note,
  .section > .contrast-figure {
    grid-row: auto;
    grid-column: 1;
  }
}

@media (max-width: 900px) {
  .contrast-panels {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
  }
}

@media (max-width: 640px) {
  .section > .contrast-subhead {
    margin-top: 72px;
  }
}

/* ------------------------------------------------------------------ open callers */

/* The fold line is drawn with the safe-tile timing charts below (scripts/build_open_callers_figure.py):
   LuckyJ in jade, the humans' fitted curve in the gray NAGA takes there. */

/* ------------------------------------------------------------------ safe-tile timing */

/* Small charts on one plate, drawn like the personal guide's: one jade dot per discard (sized by its
   choices) under LuckyJ's fitted curve and its 95% band, NAGA's or the humans' fitted curve in a
   recessive gray, and the half below 50% washed vermilion, where the safe tile goes first. The SVG is
   static, written by scripts/build_safe_tile_timing_figures.py and scripts/build_open_callers_figure.py;
   app.js adds the crosshair and the tooltip. */
.section > .timing-figure {
  grid-column: 2 / 4;
  margin: 48px 0 0;
}

.section > .timing-figure.is-single {
  grid-column: 2;
}

.timing-plate {
  display: grid;
  gap: 8px;
  padding: 22px 24px 18px;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: var(--plate);
  --timing-lj: var(--jade-mark);
  --timing-naga: #948d82;
  --timing-threat: var(--verm-mark);
}

.timing-figure.is-single .timing-plate {
  max-width: 480px;
}

.timing-plate p {
  margin: 0;
}

.timing-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.timing-sub {
  max-width: 640px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
}

.timing-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 6px !important;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
}

.timing-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.timing-key::before {
  flex: none;
  content: "";
}

.timing-key.lj::before {
  width: 22px;
  height: 10px;
  background:
    radial-gradient(circle, var(--timing-lj) 0 3.5px, transparent 4px) center / 10px 10px no-repeat,
    linear-gradient(var(--timing-lj), var(--timing-lj)) center / 22px 2px no-repeat;
}

.timing-key:is(.naga, .humans)::before {
  width: 22px;
  height: 2px;
  background: var(--timing-naga);
}

.timing-key.band::before {
  width: 14px;
  height: 14px;
  border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--timing-lj) 16%, var(--plate));
}

.timing-key.wash::before {
  width: 14px;
  height: 14px;
  border: 1px solid var(--hair);
  background: var(--verm-soft);
}

.timing-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 400px));
  gap: 28px 40px;
  margin-top: 12px;
}

.timing-figure.is-single .timing-panels {
  grid-template-columns: minmax(0, 420px);
  margin-top: 4px;
}

.timing-panel {
  display: grid;
  align-content: start;
  gap: 6px;
}

.timing-panel-title {
  display: grid;
  gap: 2px;
}

.timing-panel-title b {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.timing-panel-title span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
}

.timing-plot {
  position: relative;
}

.timing-plot svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.timing-plate .timing-wash {
  fill: var(--verm-soft);
  opacity: 0.5;
}

.timing-plate .timing-band {
  fill: var(--timing-lj);
  opacity: 0.14;
}

.timing-plate .timing-grid {
  stroke: var(--hair-2);
  stroke-width: 1;
}

.timing-plate .timing-mid {
  stroke: var(--hair);
  stroke-width: 1;
}

.timing-plate :is(.timing-tick, .timing-cat, .timing-axis, .timing-label, .timing-note) {
  font-family: var(--sans);
}

.timing-plate .timing-tick {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: end;
}

.timing-plate .timing-cat {
  fill: var(--ink-2);
  font-size: 11px;
  text-anchor: middle;
}

.timing-plate .timing-axis {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: middle;
}

.timing-plate .timing-label {
  fill: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  text-anchor: middle;
}

.timing-plate .timing-label.is-start,
.timing-plate .timing-note.is-start {
  text-anchor: start;
}

.timing-plate .timing-label.is-end,
.timing-plate .timing-note.is-end {
  text-anchor: end;
}

.timing-plate .timing-note {
  fill: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
}

.timing-plate :is(.timing-line, .timing-fit) {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timing-plate .timing-fit.lj {
  stroke: var(--timing-lj);
}

.timing-plate .timing-fit:is(.naga, .humans) {
  stroke: var(--timing-naga);
}

.timing-plate .timing-line.threat {
  stroke: var(--timing-threat);
}

.timing-plate .timing-area {
  fill: var(--timing-threat);
  opacity: 0.1;
}

.timing-plate .timing-dot {
  stroke: var(--plate);
  stroke-width: 2;
}

.timing-plate .timing-dot.lj {
  fill: var(--timing-lj);
  fill-opacity: 0.8;
  stroke-width: 1.5;
}

.timing-plate .timing-dot.threat {
  fill: var(--timing-threat);
}

.timing-plate .timing-switch {
  fill: var(--plate);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.timing-plate .timing-cross {
  stroke: var(--ink);
  stroke-opacity: 0;
  stroke-width: 1;
}

.timing-plate .timing-cross.is-on {
  stroke-opacity: 0.3;
}

.timing-plate .timing-hit {
  fill: transparent;
  cursor: crosshair;
  outline: none;
}

.timing-tip {
  position: absolute;
  top: 4px;
  z-index: 3;
  display: grid;
  gap: 4px;
  min-width: 132px;
  padding: 8px 10px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--plate);
  font-family: var(--sans);
  pointer-events: none;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.45);
}

.timing-tip[hidden] {
  display: none;
}

.timing-tip span {
  color: var(--hair);
  font-size: 12px;
}

.timing-tip b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.timing-tip b::before {
  width: 12px;
  height: 2px;
  background: var(--hair);
  content: "";
}

.timing-tip b.lj::before {
  background: #5fc49a;
}

.timing-tip b:is(.naga, .humans)::before {
  background: #c9c2b6;
}

.timing-tip b.threat::before {
  background: var(--verm-felt);
}

.timing-tip small {
  color: var(--hair);
  font-size: 12.5px;
  font-weight: 400;
}

.timing-figure figcaption {
  max-width: var(--text-w);
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}

.timing-table {
  max-width: var(--text-w);
  margin-top: 12px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.timing-table > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
}

.timing-table > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
}

.timing-table-scroll {
  overflow-x: auto;
  padding-bottom: 12px;
}

.timing-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 12.5px;
}

.timing-table table.is-narrow {
  width: auto;
  min-width: 300px;
}

.timing-table :is(th, td) {
  padding: 7px 10px 7px 0;
  border-top: 1px solid var(--hair-2);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.timing-table thead th {
  border-top: 0;
  color: var(--muted);
  font-weight: 500;
}

.timing-table tbody th {
  color: var(--ink-2);
  font-weight: 600;
}

.timing-table td :is(b, span, small) {
  display: block;
}

.timing-table td b {
  color: var(--jade);
  font-weight: 650;
}

.timing-table td span {
  color: var(--ink-2);
}

.timing-table td small {
  color: var(--muted);
  font-size: 11.5px;
}

html:lang(ja) :is(.timing-title, .timing-sub, .timing-legend, .timing-panel-title span, .timing-figure figcaption, .timing-table) {
  letter-spacing: 0.02em;
}

@media (max-width: 1023px) {
  .section > .timing-figure,
  .section > .timing-figure.is-single {
    grid-column: 1;
  }
}

@media (max-width: 900px) {
  .timing-panels {
    grid-template-columns: minmax(0, 440px);
  }
}

@media (max-width: 640px) {
  .timing-plate {
    padding: 16px 14px 14px;
  }

  .timing-plate :is(.timing-tick, .timing-cat, .timing-axis) {
    font-size: 13px;
  }

  .timing-plate .timing-label {
    font-size: 14.5px;
  }

  .timing-plate .timing-note {
    font-size: 12.5px;
  }
}

/* ------------------------------------------------------------------ cover (home, and the top of each book) */

.cover {
  position: relative;
  margin-top: calc(-1 * var(--head-h));
  padding: calc(var(--head-h) + 88px) max(var(--page-pad), calc((100% - var(--book-w)) / 2)) 56px;
  background: var(--felt-bg);
  color: var(--cream);
}

.cover-inner {
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(0, 1fr);
  column-gap: 72px;
  align-items: start;
}

.cover-text {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.cover-eyebrow {
  color: var(--cream-3);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.cover-title {
  display: grid;
  gap: 12px;
  font-weight: 500;
}

.cover-lead {
  color: var(--cream-2);
  font-size: 38px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.1;
}

.cover-main {
  color: var(--cream);
  font-size: clamp(64px, 7.4vw, 108px);
  letter-spacing: -0.022em;
  line-height: 0.93;
  text-wrap: balance;
}

html:lang(ja) .cover-lead {
  font-size: 22px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.04em;
}

html:lang(ja) .cover-main {
  font-size: clamp(40px, 4.6vw, 64px);
  letter-spacing: 0;
  line-height: 1.22;
}

.cover-standfirst {
  max-width: 600px;
  color: var(--cream-2);
  font-size: 22px;
  line-height: 1.52;
  text-wrap: pretty;
}

html:lang(ja) .cover-standfirst {
  font-size: 18px;
  line-height: 1.9;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin-top: 4px;
}

.cover-plate {
  display: grid;
  align-content: start;
  gap: 22px;
  min-width: 0;
  padding-top: 58px;
  container-type: inline-size;
}

.cover-plate .figure-label {
  color: var(--cream-3);
}

.cover-hand {
  display: flex;
  align-items: flex-end;
  padding-top: 44px;
}

/* Fourteen tiles and the gap fill the plate: 14.3 tiles of 0.554em each. */
.cover-hand .tiles {
  display: block;
  font-size: min(63px, 12.4cqw);
}

.cover-drawn {
  position: relative;
  display: block;
  margin-left: 0.3em;
  font-size: min(63px, 12.4cqw);
}

.cover-drawn .tiles {
  font-size: 1em;
  transform: translateY(-0.22em);
}

/* The drawn tile ends the row at the plate's edge, so its tag hangs leftward from the tile. */
.cover-tag {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.42em);
  padding: 5px 8px;
  border-radius: 2px;
  background: var(--jade-felt);
  color: var(--felt-deep);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.cover-plate figcaption {
  max-width: 480px;
  color: var(--cream-2);
  font-size: 19px;
  font-style: italic;
  line-height: 1.5;
  text-wrap: pretty;
}

html:lang(ja) .cover-plate figcaption {
  font-size: 16px;
  font-style: normal;
  line-height: 1.85;
}

.cover-plate figcaption .inline-tile {
  font-size: 1.45em;
}

.cover-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 88px;
  border-top: 1px solid rgba(244, 240, 230, 0.16);
}

.cover-stats > div,
.cover-stats .metric {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 28px 24px 0;
  border-left: 1px solid rgba(244, 240, 230, 0.16);
}

.cover-stats > div:first-child,
.cover-stats .metric:nth-child(4n + 1) {
  padding-left: 0;
  border-left: 0;
}

.cover-stats b {
  color: var(--cream);
  font-family: var(--sans);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.cover-stats span {
  max-width: 240px;
  color: var(--cream-2);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

/* The JavaScript metrics on the book pages: eight tiles in two rows. */
.cover-stats.metrics-grid .metric:nth-child(n + 5) {
  padding-top: 22px;
}

.cover-stats.metrics-grid .metric:nth-child(n + 5) b {
  font-size: 32px;
}

/* A shorter title band on points.html: the same parts without the plate. */
.cover.is-compact {
  padding-top: calc(var(--head-h) + 72px);
  padding-bottom: 48px;
}

.cover.is-compact .cover-inner {
  grid-template-columns: minmax(0, 760px);
}

.cover.is-compact .cover-main {
  font-size: clamp(48px, 5.4vw, 80px);
}

.cover.is-compact .cover-stats {
  margin-top: 56px;
}

/* ------------------------------------------------------------------ contents */

.contents {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  column-gap: 72px;
  max-width: calc(var(--book-w) + 2 * var(--page-pad));
  margin: 0 auto;
  padding: 112px var(--page-pad) 16px;
}

.contents-intro {
  display: grid;
  align-content: start;
  gap: 20px;
}

.contents-intro h2 {
  font-size: 60px;
  letter-spacing: -0.015em;
  line-height: 1;
}

html:lang(ja) .contents-intro h2 {
  font-size: 44px;
}

.contents-intro p {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}

.contents-body {
  display: grid;
  gap: 56px;
  min-width: 0;
}

.contents-group {
  display: grid;
  gap: 14px;
}

.contents-group > .label.is-rubric {
  color: var(--verm);
}

.contents-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contents-list.is-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 40px;
}

.contents-list.is-points {
  border-bottom: 1px solid var(--hair);
}

.contents-list li {
  border-top: 1px solid var(--hair);
}

.contents-list a {
  display: grid;
  align-content: start;
  gap: 4px;
  height: 100%;
  padding: 16px 0 18px;
  color: var(--ink);
  text-decoration: none;
}

.contents-list.is-points a {
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 16px;
  padding: 22px 0 24px;
}

.contents-list a:hover .contents-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.contents-num {
  grid-row: 1 / span 2;
  color: var(--verm);
  font-size: 32px;
  font-style: italic;
  line-height: 1;
}

.contents-title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
}

.contents-list.is-points .contents-title {
  font-size: 23px;
  letter-spacing: -0.005em;
  line-height: 1.22;
}

html:lang(ja) .contents-list.is-points .contents-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
}

.contents-sub {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.45;
  text-wrap: pretty;
}

.contents-list.is-points .contents-sub {
  margin-top: 3px;
  font-size: 16.5px;
  line-height: 1.5;
}

html:lang(ja) .contents-sub,
html:lang(ja) .contents-list.is-points .contents-sub {
  font-size: 14.5px;
  line-height: 1.8;
}

.book-method {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 40px;
  border-top: 1px solid var(--hair);
}

.book-method > div {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 0 4px;
}

.book-method b {
  color: var(--verm);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.book-method p {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
}

.guide-insert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 36px;
  padding: 34px 38px;
  border: 1px solid var(--hair);
  background: var(--plate);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 0 var(--hair-2), 0 18px 40px -28px rgba(30, 26, 20, 0.35);
}

.guide-insert:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.guide-insert-text {
  display: grid;
  gap: 12px;
}

.guide-insert .label {
  color: var(--verm);
}

.guide-insert-title {
  font-size: 40px;
  font-style: italic;
  line-height: 1.05;
}

.guide-insert p {
  max-width: 560px;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.5;
}

.guide-insert-news {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14.5px;
}

.guide-insert .button-link {
  justify-self: start;
}

/* ------------------------------------------------------------------ colophon */

.colophon {
  margin-top: 104px;
  border-top: 1px solid var(--hair);
}

.colophon-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px 64px;
  max-width: calc(var(--book-w) + 2 * var(--page-pad));
  margin: 0 auto;
  padding: 44px var(--page-pad) 56px;
}

.colophon-sources {
  display: grid;
  gap: 12px;
}

.colophon-sources p:not(.label) {
  max-width: 720px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.colophon-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-family: var(--sans);
  font-size: 14px;
  text-decoration-color: rgba(0, 98, 67, 0.35);
}

.colophon-meta {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
}

.colophon-meta .lang-alt {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 18px;
}

.colophon-meta .lang-alt:lang(en) {
  font-family: var(--serif);
  font-style: italic;
}

.colophon-meta p {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}

.commit-stamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.commit-stamp::before {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--jade-mark);
  content: "";
}

.commit-stamp.is-fallback::before {
  background: var(--back);
}

.commit-stamp:hover {
  color: var(--jade);
}

.commit-stamp.is-floating {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 12;
  padding: 6px 10px;
  border: 1px solid var(--hair);
  background: rgba(249, 246, 241, 0.94);
}

@media print {
  .running-head,
  .contents-panel,
  .commit-stamp.is-floating {
    display: none;
  }
}

/* ------------------------------------------------------------------ tiles */

/* The tile font has one upright face. In italic or bold text (a replay caption, the cover caption) the
   browser would otherwise slant or thicken the tile pictures, so tiles never inherit either. */
.tiles {
  font-family: "mahjongtile-clr", "mahjongtile";
  font-size: var(--tile-size);
  font-style: normal;
  font-weight: normal;
  font-synthesis: none;
  letter-spacing: -0.112em;
  line-height: 1;
  position: relative;
  white-space: nowrap;
}

.tiles.otf {
  font-family: "mahjongtile";
  letter-spacing: -0.086em;
}

.tiles.colr {
  font-family: "mahjongtile-colr";
}

.tile-list {
  margin: 8px 0 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.hand-tiles {
  display: inline-block;
  font-size: 2.35em;
}

.inline-tile {
  display: inline-block;
  font-size: 1.85em;
  top: 0.12em;
  /* 0.112em gives back the glyph's negative letter-spacing; the rest is the gap before the next word. */
  padding-right: 0.16em;
}

.discard-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discard-tile {
  font-size: 2.15em;
}

.discard-line em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.call-action-line em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.mini-tile {
  display: inline-block;
  font-size: 1.58em;
  line-height: 1;
}

.mini-hand,
.river {
  overflow-x: auto;
  padding: 2px 0 4px;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  font-size: 12px;
}

.meld {
  border: 1px solid var(--hair);
  display: inline-block;
  margin-right: 5px;
  padding: 1px 4px 2px;
}

/* ------------------------------------------------------------------ the mahjong table (layout tuned in 48fc544 and ea26a49; only colours changed) */

.lucky-table-wrap {
  display: flex;
  justify-content: center;
  margin: 14px 0 12px;
  overflow-x: auto;
}

.caption-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-width: min-content;
}

.caption-content {
  border: 1px solid var(--felt-line);
  border-radius: 10px;
  background: var(--felt-table);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  color: var(--cream);
  /* 11px of padding and 1px of border: the 24px the table's width formula leaves for them. */
  padding: 11px;
}

.caption-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
  max-width: 560px;
  text-align: center;
}

.mahjong-table {
  --display-base: clamp(0.54rem, 1.05vw, 0.9rem);
  --table-dark: var(--felt-deep);
  --table-light: var(--cream);
  display: grid;
  grid-template-areas:
    ".            hand-across     hand-across      hand-across   ."
    "hand-prev    discards-across discards-across  discards-next  hand-next"
    "hand-prev    discards-prev   center           discards-next  hand-next"
    "hand-prev    discards-prev   discards-current discards-current hand-next"
    "hand-current hand-current    hand-current     hand-current   hand-current";
  grid-template-columns: 1fr 3fr 3fr 3fr 1fr;
  /* The hand rows take the height of what they hold, since a hand with calls is taller. The river
     rows hold three rows of tiles (7.8) and the middle row the centre box (9), each with a small gap.
     A fixed table height let a tall hand squeeze the river under it until the river ran into it. */
  grid-template-rows:
    auto calc(8.1 * var(--display-base)) calc(9.2 * var(--display-base)) calc(8.1 * var(--display-base))
    auto;
  margin: 0 auto;
  max-width: 34em;
  width: calc(36 * var(--display-base));
}

.mahjong-table .center {
  border: 1px solid var(--felt-line);
  border-radius: calc(0.35 * var(--display-base));
  background: rgba(12, 47, 34, 0.5);
  color: var(--cream);
  display: grid;
  font-size: calc(1 * var(--display-base));
  grid-area: center;
  grid-template-areas:
    ". score-across ."
    "score-prev situation-box score-next"
    ". score-current .";
  grid-template-columns: 2fr 5fr 2fr;
  grid-template-rows: 2fr 5fr 2fr;
  height: calc(9 * var(--display-base));
  width: calc(9 * var(--display-base));
}

.mahjong-table .situation-container {
  background: var(--table-dark);
  color: var(--table-light);
  display: flex;
  flex-direction: column;
  grid-area: situation-box;
  height: calc(4.7 * var(--display-base));
  justify-content: center;
  padding: calc(0.45 * var(--display-base));
  width: calc(4.7 * var(--display-base));
}

.mahjong-table .round-container,
.mahjong-table .dora-indicator {
  align-items: center;
  display: flex;
  flex: 1 1 50%;
  justify-content: center;
  text-align: center;
}

.mahjong-table .round {
  font-family: var(--serif);
  font-size: 0.84em;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.mahjong-table .dora-indicator {
  border-top: 1px solid var(--felt-line);
  font-size: calc(0.76 * var(--display-base));
  gap: 2px;
}

.mahjong-table .center .player-score {
  align-items: center;
  color: var(--cream);
  display: flex;
  flex-direction: row;
  font-family: var(--sans);
  font-size: calc(0.85 * var(--display-base));
  font-weight: 600;
}

.mahjong-table .player-score .wind {
  background: var(--table-dark);
  color: var(--table-light);
  height: calc(1.25 * var(--display-base));
  line-height: calc(1.2 * var(--display-base));
  margin: calc(0.15 * var(--display-base));
  text-align: center;
  width: calc(1.25 * var(--display-base));
}

.mahjong-table .player-score.player-current {
  grid-area: score-current;
}

.mahjong-table .player-score.player-next {
  grid-area: score-next;
}

.mahjong-table .player-score.player-across {
  grid-area: score-across;
}

.mahjong-table .player-score.player-prev {
  grid-area: score-prev;
}

.mahjong-table .player-hand {
  align-self: center;
  display: flex;
  flex-direction: column;
  font-size: calc(1 * var(--display-base));
  justify-self: center;
  max-width: calc(15 * var(--display-base));
}

.mahjong-table .player-hand.player-current {
  font-size: calc(1.14 * var(--display-base));
  grid-area: hand-current;
  max-width: none;
}

.mahjong-table .player-hand.player-next {
  grid-area: hand-next;
}

.mahjong-table .player-hand.player-across {
  grid-area: hand-across;
}

.mahjong-table .player-hand.player-prev {
  grid-area: hand-prev;
}

.mahjong-table .player-discards {
  font-size: calc(1 * var(--display-base));
  min-height: calc(5 * var(--display-base));
  min-width: calc(5 * var(--display-base));
}

.mahjong-table .player-discards.player-current {
  align-self: start;
  grid-area: discards-current;
  justify-self: start;
}

.mahjong-table .player-discards.player-next {
  align-self: end;
  grid-area: discards-next;
  justify-self: start;
}

.mahjong-table .player-discards.player-across {
  align-self: end;
  grid-area: discards-across;
  justify-self: end;
}

.mahjong-table .player-discards.player-prev {
  align-self: start;
  grid-area: discards-prev;
  justify-self: end;
}

.mahjong-table .player-prev,
.mahjong-table .player-next {
  writing-mode: vertical-rl;
}

.mahjong-table .player-across,
.mahjong-table .player-next {
  transform: rotate(180deg);
}

.mahjong-table .player-name {
  color: var(--cream-3);
  font-family: var(--sans);
  font-size: calc(0.74 * var(--display-base));
  line-height: 1.2;
  margin-bottom: calc(0.3 * var(--display-base));
}

.mahjong-table .player-current .player-name {
  color: var(--cream);
  font-weight: 700;
}

.mahjong-table .player-across .player-name {
  text-align: right;
  transform: rotate(180deg);
}

.table-tile-group {
  align-items: center;
  display: flex;
  gap: calc(0.25 * var(--display-base));
}

.tile-threat-hand {
  align-items: flex-end;
  display: inline-flex;
  gap: calc(0.025 * var(--tile-size));
  padding-top: calc(0.08 * var(--tile-size));
  white-space: nowrap;
}

.tile-threat-cell {
  align-items: center;
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-end;
  line-height: 1;
  min-width: 0.76em;
}

.tile-threat-bars {
  align-items: end;
  display: grid;
  gap: calc(0.035 * var(--tile-size));
  grid-template-columns: repeat(3, calc(0.055 * var(--tile-size)));
  height: calc(0.4 * var(--tile-size));
  margin-bottom: calc(-0.082 * var(--tile-size));
  position: relative;
  z-index: 1;
}

.tile-threat-bar {
  background: linear-gradient(to top, #247a50 0%, #d8ad3d 52%, #d86a38 84%, var(--red) 100%);
  border-radius: 999px;
  clip-path: inset(calc(100% - var(--bar-level, 0%)) 0 0 0);
  display: block;
  height: 100%;
  min-width: 2px;
  width: 100%;
}

.mahjong-table .hand.compact {
  align-items: center;
  border: 0;
  display: flex;
  flex-direction: row;
  padding: 0;
}

.mahjong-table .hand-contents .tiles,
.mahjong-table .discard-row .tiles,
.mahjong-table .table-melds .tiles {
  font-size: var(--tile-size);
}

.discard-row {
  block-size: var(--tile-size);
  height: var(--tile-size);
  white-space: nowrap;
}

.discard-tiles {
  align-items: center;
  display: inline-flex;
  line-height: 1;
  white-space: nowrap;
}

.discard-tile-slot {
  --discard-step: calc(0.554 * var(--tile-size));
  align-items: center;
  display: inline-flex;
  flex: 0 0 var(--discard-step);
  justify-content: center;
  min-block-size: var(--tile-size);
  min-inline-size: var(--discard-step);
  width: var(--discard-step);
}

.riichi-discard-slot {
  flex-basis: var(--tile-size);
  min-inline-size: var(--tile-size);
  width: var(--tile-size);
}

/* Another player called this tile out of the pond: it keeps its place, faint. */
.called-discard-slot {
  opacity: 0.32;
}

.riichi-discard-tile {
  --riichi-align-shift: calc(0.086 * var(--tile-size));
  display: inline-block;
  position: relative;
  transform: rotate(90deg);
  transform-origin: center;
}

.mahjong-table .player-current .riichi-discard-tile,
.mahjong-table .player-across .riichi-discard-tile {
  top: calc(-1 * var(--riichi-align-shift));
}

.mahjong-table .player-prev .riichi-discard-tile,
.mahjong-table .player-next .riichi-discard-tile {
  left: var(--riichi-align-shift);
}

.table-melds {
  display: flex;
  flex-wrap: nowrap;
  gap: calc(0.3 * var(--display-base));
  margin-top: calc(0.25 * var(--display-base));
  white-space: nowrap;
}

.meld-run {
  --called-step: calc(0.86 * var(--tile-size));
  --kan-stack-edge-shift: 0px;
  --kan-stack-offset: calc(0.11 * var(--tile-size));
  --meld-step: calc(0.554 * var(--tile-size));
  border: 1px solid var(--felt-line);
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0 calc(0.18 * var(--display-base));
  vertical-align: middle;
  white-space: nowrap;
}

.meld-tile-slot {
  align-items: center;
  display: inline-flex;
  flex: 0 0 var(--meld-step);
  height: calc(1.08 * var(--tile-size));
  justify-content: flex-start;
  line-height: 1;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  width: var(--meld-step);
}

.called-tile-slot {
  flex-basis: var(--called-step);
  justify-content: center;
  width: var(--called-step);
}

.added-kan-slot {
  min-height: calc(1.14 * var(--tile-size));
}

.added-kan-stack {
  display: inline-block;
  height: calc(1.14 * var(--tile-size));
  line-height: 1;
  position: relative;
  width: var(--called-step);
}

.added-kan-stack .added-kan-stack-tile {
  left: 50%;
  position: absolute;
  top: calc(50% - var(--kan-stack-offset));
  transform: translate(calc(-50% + var(--kan-stack-edge-shift)), -50%) rotate(90deg);
  transform-origin: center;
}

.added-kan-stack .added-kan-stack-tile + .added-kan-stack-tile {
  top: calc(50% + var(--kan-stack-offset));
}

.mahjong-table .player-prev .added-kan-slot {
  --kan-stack-edge-shift: 0px;
}

.mahjong-table .player-next .added-kan-slot {
  --kan-stack-edge-shift: 0px;
}

.mahjong-table .player-prev .added-kan-stack,
.mahjong-table .player-next .added-kan-stack {
  --kan-stack-offset: calc(0.1 * var(--tile-size));
  height: var(--called-step);
  width: calc(1.14 * var(--tile-size));
}

.mahjong-table .player-prev .added-kan-stack .added-kan-stack-tile,
.mahjong-table .player-next .added-kan-stack .added-kan-stack-tile {
  left: calc(50% - var(--kan-stack-offset));
  top: calc(50% - 0.04 * var(--tile-size));
  transform: translate(calc(-50% + var(--kan-stack-edge-shift)), -50%) rotate(90deg);
}

.mahjong-table .player-prev .added-kan-stack .added-kan-stack-tile + .added-kan-stack-tile,
.mahjong-table .player-next .added-kan-stack .added-kan-stack-tile + .added-kan-stack-tile {
  left: calc(50% + var(--kan-stack-offset));
  top: calc(50% - 0.04 * var(--tile-size));
  transform: translate(calc(-50% + var(--kan-stack-edge-shift)), -50%) rotate(90deg);
}

.mahjong-table .player-prev .added-kan-run .added-kan-neighbor-before,
.mahjong-table .player-next .added-kan-run .added-kan-neighbor-before {
  transform: translateY(calc(0.12 * var(--tile-size)));
}

.mahjong-table .player-prev .added-kan-run .added-kan-neighbor-after,
.mahjong-table .player-next .added-kan-run .added-kan-neighbor-after {
  transform: translateY(calc(-0.12 * var(--tile-size)));
}

.mahjong-table .player-prev .added-kan-run.added-kan-edge-start .meld-tile-slot:not(.added-kan-slot),
.mahjong-table .player-next .added-kan-run.added-kan-edge-start .meld-tile-slot:not(.added-kan-slot) {
  transform: translateY(calc(-0.12 * var(--tile-size)));
}

.mahjong-table .player-prev .added-kan-run.added-kan-edge-end .meld-tile-slot:not(.added-kan-slot),
.mahjong-table .player-next .added-kan-run.added-kan-edge-end .meld-tile-slot:not(.added-kan-slot) {
  transform: translateY(calc(0.12 * var(--tile-size)));
}

.called-from-kamicha,
.called-from-toimen {
  justify-content: flex-end;
}

.called-from-toimen {
  --kan-stack-edge-shift: calc(-0.08 * var(--tile-size));
}

.called-from-shimocha {
  --kan-stack-edge-shift: calc(0.08 * var(--tile-size));
}

.tiles.meld-tile,
.called-tile {
  display: inline-block;
  letter-spacing: 0;
  line-height: 1;
}

.called-tile {
  --called-align-shift: calc(0.052 * var(--tile-size));
  position: relative;
  top: var(--called-align-shift);
  transform: rotate(90deg);
  transform-origin: center;
}

.mahjong-table .player-current .called-tile:not(.added-kan-stack-tile),
.mahjong-table .player-across .called-tile:not(.added-kan-stack-tile) {
  top: var(--called-align-shift);
}

.mahjong-table .player-prev .called-tile:not(.added-kan-stack-tile),
.mahjong-table .player-next .called-tile:not(.added-kan-stack-tile) {
  left: calc(-1 * var(--called-align-shift));
  top: auto;
}

/* Where the browser can measure the table's own column, the tiles grow to fill it, up to the size at
   which a table with calls on both sides (about 40 bases tall) still fits on the screen. The table is
   36 bases wide, inside 24px of padding and border. The base uses cqw, not cqi: the side players'
   hands and rivers are written vertically, and cqi there would read the column's height. */
@supports (container-type: inline-size) {
  .lucky-table-wrap {
    container-type: inline-size;
  }

  .mahjong-table {
    --display-base: max(0.35rem, min(calc((100cqw - 24px) / 36), calc((100svh - 32px) / 40)));
    max-width: none;
  }
}

/* ------------------------------------------------------------------ table additions for the redesign */

.mahjong-table .player-score .wind.is-dealer {
  background: var(--verm-felt);
  color: var(--felt-deep);
  font-weight: 700;
}

/* Concealed opponents: tile backs take the place of the tiles, at the same size, until the reader
   answers the replay's question or turns the hands on. */
.tile-backs {
  display: none;
  align-items: center;
  gap: calc(0.02 * var(--tile-size));
  font-size: var(--tile-size);
  line-height: 1;
  white-space: nowrap;
}

.tile-backs i {
  display: inline-block;
  flex: 0 0 auto;
  box-sizing: border-box;
  inline-size: 0.534em;
  block-size: 0.8em;
  margin-block: 0.06em;
  border: 1px solid #9e7631;
  border-radius: 0.07em;
  background: linear-gradient(180deg, #ddb15f, var(--back));
  box-shadow: inset 0 -0.05em 0 rgba(0, 0, 0, 0.18);
}

.conceal-hands .mahjong-table .player-hand:not(.player-current) .hand-contents > .tiles,
.conceal-hands .mahjong-table .player-hand:not(.player-current) .hand-contents > .empty {
  display: none;
}

.conceal-hands .mahjong-table .player-hand:not(.player-current) .tile-backs {
  display: inline-flex;
}

/* The tile you drew sits apart at the right end of the hand. */
.mahjong-table .tile-threat-cell.is-drawn,
.mahjong-table .tile-threat-cell.guide-drawn {
  margin-inline-start: 0.5em;
}

/* Marked tiles in the bottom hand: lifted, with a coloured bar and a short label under it. */
.mahjong-table .tile-threat-cell[data-mark] {
  position: relative;
}

.mahjong-table .tile-threat-cell[data-mark] > .tiles {
  transform: translateY(-0.14em);
}

.mahjong-table .tile-threat-cell[data-mark]::before {
  position: absolute;
  right: 14%;
  bottom: -0.18em;
  left: 14%;
  height: 0.2em;
  border-radius: 999px;
  background: var(--cream-2);
  content: "";
}

.mahjong-table .tile-threat-cell[data-mark]::after {
  position: absolute;
  top: calc(100% + 0.32em);
  left: 50%;
  padding: 0.18em 0.4em;
  border-radius: 0.15em;
  content: attr(data-mark);
  font-family: var(--sans);
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
}

.mahjong-table .tile-threat-cell.is-luckyj-cut::before,
.mahjong-table .tile-threat-cell.guide-better::before {
  background: var(--jade-felt);
}

.mahjong-table .tile-threat-cell.is-luckyj-cut::after,
.mahjong-table .tile-threat-cell.guide-better::after {
  background: var(--jade-felt);
  color: var(--felt-deep);
}

.mahjong-table .tile-threat-cell.is-model-cut::before {
  background: var(--cream-2);
}

.mahjong-table .tile-threat-cell.is-model-cut::after {
  background: var(--felt-deep);
  box-shadow: inset 0 0 0 1px var(--cream-2);
  color: var(--cream);
}

.mahjong-table .tile-threat-cell.guide-cut::before {
  background: var(--verm-felt);
}

.mahjong-table .tile-threat-cell.guide-cut::after {
  background: var(--verm-felt);
  color: var(--felt-deep);
}

/* Two labels on one tile (the guide's riichi frames mark the same tile twice): the second sits lower. */
.mahjong-table .tile-threat-cell.is-model-cut.is-luckyj-cut::after {
  background: var(--jade-felt);
  box-shadow: none;
  color: var(--felt-deep);
}

/* Room under the bottom hand for the labels, or between the hand and its calls when it has any. */
.mahjong-table .player-hand.player-current:has(.tile-threat-cell[data-mark]) {
  padding-bottom: 1.5em;
}

.mahjong-table .player-hand.player-current:has(.tile-threat-cell[data-mark]):has(.table-melds) {
  padding-bottom: 0;
}

.mahjong-table .player-hand.player-current:has(.tile-threat-cell[data-mark]) .table-melds {
  margin-top: 1.5em;
}

/* The player name above your own hand stays quiet on the felt. */
.mahjong-table .player-hand.player-current .player-name {
  color: var(--cream-2);
}

.mahjong-table .tile-threat-bar {
  background: linear-gradient(to top, #6fd3a2 0%, #e8c170 52%, #f29a76 84%, #ff7a5c 100%);
}

/* ------------------------------------------------------------------ narrower screens */

/* Laptops: the same three columns, tighter. */
@media (max-width: 1279px) {
  :root {
    --margin-w: 150px;
    --side-w: 236px;
    --gutter: 36px;
  }

  .point-number {
    font-size: 132px;
  }

  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Below this the replay panel is too narrow beside the table, so it moves under it. */
@media (max-width: 1179px) {
  .replay-figure {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .replay-table {
    justify-self: center;
    width: 100%;
    max-width: 640px;
  }

  .cover-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .cover-plate {
    max-width: 560px;
    padding-top: 36px;
  }

  .running-location {
    display: none;
  }
}

/* Tablets and the inner screen of a foldable: one column. Numerals sit above the chapter title,
   rubric labels above their rule, and side notes follow the text they belong to. */
@media (max-width: 1023px) {
  :root {
    --page-pad: 24px;
  }

  body {
    font-size: 19px;
  }

  .section,
  .point,
  .point-body,
  .rx-card,
  .replay-notes,
  .replay-notes .analysis-step,
  .example-tab-head,
  .contents,
  .colophon-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .section > *,
  .section > :is(.method-grid, .insight-grid, .rx-grid, .rx-ledger, .drill-list, .source-scope-card,
    .model-point-grid, .evidence-grid, .validation-grid, .audit-details, .teacher-grid),
  .section > .rule,
  .point-body > *,
  .point-body > .evidence-note,
  .rx-card > *,
  .rx-card > .rx-basis,
  .replay-notes > *,
  .replay-notes .analysis-step,
  .replay-notes > .mortal-block,
  .replay-notes > .yaku-condition-read,
  .replay-notes > .case-links,
  .example-tab-list {
    grid-row: auto;
    grid-column: 1;
  }

  .section {
    padding-top: 80px;
  }

  .section > .kicker {
    padding-top: 0;
  }

  .point {
    margin-top: 88px;
    padding-top: 64px;
  }

  .point-number {
    grid-row: 1;
    margin: 0 0 18px;
    font-size: 104px;
  }

  .point-body {
    grid-row: 2;
    grid-column: 1;
  }

  .chapter-next {
    grid-row: 3;
  }

  .point-body > [data-example],
  .point-body > [data-guide-examples] {
    margin-top: 72px;
    margin-left: 0;
  }

  .point-body > .evidence-note,
  .rx-card > .rx-basis {
    padding-top: 12px;
    border-top: 1px solid var(--hair);
  }

  .rule > strong:first-child,
  .exception > strong:first-child {
    position: static;
    display: block;
    width: auto;
    margin-bottom: 8px;
    padding: 0;
    border-top: 0;
  }

  .rule {
    padding-top: 16px;
  }

  .rx-card {
    margin-left: 0;
    padding-top: 72px;
  }

  .rx-card::before {
    grid-row: auto;
    margin-bottom: 10px;
    font-size: 72px;
  }

  .rx-ledger-head,
  .rx-ledger a {
    grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1.4fr);
  }

  .rx-ledger-head span:last-child {
    display: none;
  }

  .rx-ledger-see {
    grid-column: 3;
    margin-top: 6px;
    text-align: left;
  }

  .replay-notes .analysis-step {
    gap: 8px;
  }

  .replay-notes > .mortal-block {
    order: 5;
  }

  .example-tab-head > .label {
    padding-top: 0;
  }

  .contents {
    gap: 28px;
    padding-top: 80px;
  }

  .contents-list.is-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-method {
    grid-template-columns: minmax(0, 1fr);
  }

  .colophon-inner {
    gap: 20px;
  }

  .validation-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cover-stats,
  .cover-stats.metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover-stats > div,
  .cover-stats .metric {
    padding: 22px 16px 18px;
    border-top: 1px solid rgba(244, 240, 230, 0.16);
  }

  .cover-stats > div:nth-child(odd),
  .cover-stats .metric:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .cover-stats .metric:nth-child(4n + 1) {
    border-left: 0;
  }

  .cover-stats .metric:nth-child(even) {
    padding-left: 16px;
    border-left: 1px solid rgba(244, 240, 230, 0.16);
  }

  .running-nav a.nav-secondary {
    display: none;
  }
}

/* Phones and the outer screen of a foldable. */
@media (max-width: 640px) {
  :root {
    --page-pad: 16px;
    --head-h: 58px;
  }

  body {
    font-size: 17.5px;
  }

  html:lang(ja) body {
    font-size: 16px;
  }

  .running-head {
    gap: 10px;
  }

  .book-title {
    font-size: 18px;
  }

  .edition-tag,
  .running-nav a.nav-tertiary {
    display: none;
  }

  .running-nav .lang-link {
    margin-left: 4px;
    padding: 0 10px;
  }

  .running-nav a,
  .running-nav button {
    padding: 0 10px;
  }

  .contents-panel {
    right: 8px;
    left: 8px;
    width: auto;
  }

  .section {
    padding-top: 64px;
  }

  .section > h2 {
    font-size: 32px;
  }

  .point {
    margin-top: 64px;
    padding-top: 48px;
  }

  .point-number {
    font-size: 80px;
  }

  .point h3 {
    font-size: 36px;
  }

  html:lang(ja) .point h3 {
    font-size: 28px;
  }

  .point-body > h3 + p,
  .point-body > .standfirst {
    font-size: 20px;
  }

  html:lang(ja) .point-body > h3 + p,
  html:lang(ja) .point-body > .standfirst {
    font-size: 17.5px;
  }

  .rule {
    font-size: 20.5px;
  }

  html:lang(ja) .rule {
    font-size: 18px;
  }

  .exception,
  .analysis-step p {
    font-size: 17.5px;
  }

  .chapter-next-title {
    font-size: 24px;
  }

  /* Figures run to the screen edges. */
  .replay-figure {
    margin-right: calc(-1 * var(--page-pad));
    margin-left: calc(-1 * var(--page-pad));
    border-radius: 0;
  }

  .replay-figure {
    padding: 8px 8px 22px;
  }

  .replay-table .caption-content {
    padding: 8px;
  }

  .replay-panel {
    padding: 4px 8px 0;
  }

  .replay-caption {
    font-size: 20px;
  }

  .quiz-choice {
    gap: 10px;
    min-height: 68px;
    padding: 8px 10px;
  }

  .quiz-choice .tiles {
    font-size: 40px;
  }

  .quiz-choice-action {
    font-size: 15px;
  }

  .replay-answer .comparison,
  .replay-panel .comparison,
  .comparison {
    grid-template-columns: minmax(0, 1fr);
  }

  .rx-ledger-head {
    display: none;
  }

  .rx-ledger a {
    grid-template-columns: 32px minmax(0, 1fr);
    row-gap: 6px;
  }

  .rx-ledger-default,
  .rx-ledger-see {
    grid-column: 2;
    margin-top: 0;
  }

  .method-grid,
  .insight-grid,
  .drill-list,
  .evidence-grid,
  .safety-timing,
  .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  .bar-row b {
    grid-column: 1 / -1;
  }

  .cover {
    padding-top: calc(var(--head-h) + 36px);
    padding-bottom: 32px;
  }

  .cover-text {
    gap: 22px;
  }

  .cover-lead {
    font-size: 24px;
  }

  .cover-main {
    font-size: 56px;
  }

  html:lang(ja) .cover-main {
    font-size: 36px;
  }

  .cover-standfirst {
    font-size: 18px;
  }

  .cover-actions {
    display: grid;
    gap: 4px;
  }

  .cover-actions .button-link {
    justify-content: center;
  }

  .cover-plate figcaption {
    font-size: 16px;
  }

  .cover-stats {
    margin-top: 36px;
  }

  .cover-stats b {
    font-size: 32px;
  }

  .cover-stats span {
    font-size: 13.5px;
  }

  .contents {
    padding-top: 56px;
  }

  .contents-intro h2 {
    font-size: 40px;
  }

  .contents-list,
  .contents-list.is-three {
    grid-template-columns: minmax(0, 1fr);
  }

  .contents-list.is-points a {
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px;
    padding: 14px 0;
  }

  .contents-list.is-points .contents-num {
    font-size: 24px;
  }

  .contents-list.is-points .contents-title {
    font-size: 19px;
  }

  .contents-list.is-points .contents-sub {
    display: none;
  }

  .guide-insert {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 24px 20px;
  }

  .guide-insert-title {
    font-size: 30px;
  }

  .consensus-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 400px) {
  .running-head {
    gap: 8px;
  }

  .book-title {
    font-size: 15.5px;
  }

  .running-nav a,
  .running-nav button {
    padding: 0 7px;
  }

  .running-nav .lang-link {
    margin-left: 2px;
    padding: 0 7px;
  }
}

@media (max-width: 380px) {
  .quiz-choices {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* On the narrowest phones the mark alone stands for the book, and still links home. */
@media (max-width: 370px) {
  .book-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Folded sections show a small chevron that turns when they open. */
:is(.audit-details, .guide-chart-table, .guide-options, .timing-table) > summary {
  list-style: none;
}

:is(.audit-details, .guide-chart-table, .guide-options, .timing-table) > summary::-webkit-details-marker {
  display: none;
}

:is(.audit-details, .guide-chart-table, .guide-options, .timing-table) > summary::before {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin-right: 10px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--muted);
  content: "";
  transition: transform 120ms ease;
}

:is(.audit-details, .guide-chart-table, .guide-options, .timing-table)[open] > summary::before {
  transform: rotate(90deg);
}

/* Tiles inside running prose sit on the line without pushing the lines apart. */
:is(p, li, figcaption, blockquote, h5) > .tiles.inline-tile,
:is(p, li, figcaption) > b > .tiles.inline-tile {
  display: inline;
  top: 0;
  font-size: 1.42em;
  line-height: 0;
  vertical-align: -0.2em;
}

/* Small interface text needs a larger tile than prose does to read at all. */
.safety-read p > .tiles.inline-tile {
  font-size: 1.85em;
  vertical-align: -0.3em;
}

/* Tiles inside decision lines keep their own size and face. */
.decision .discard-line .tiles,
.decision .call-action-line .tiles {
  display: inline-block;
  font-size: 2.1em;
  line-height: 1;
  vertical-align: middle;
}

/* Japanese headings break between phrases, not inside words. */
html:lang(ja) :is(h1, h2, h3, h4, .cover-main, .cover-lead, .chapter-next-title, .contents-title) {
  word-break: auto-phrase;
}
