/* 頒布帳: the page CSS the kit lacks (Japanese text, articles, the calculator, the ledger window in the hero).
   Tokens come from system.css; no new colours, radii or spacing steps. */

/* Japanese runs: headings need open tracking, body a taller line */
html[lang="ja"] body { line-height: 1.8; font-feature-settings: "palt" 0; }
html[lang="ja"] :is(h1, h2, h3, h4, .t-lead, .hero__lead, .t-card) { line-break: strict; word-break: auto-phrase; overflow-wrap: anywhere; }
html[lang="ja"] .hero h1 { line-height: 1.18; letter-spacing: 0; }
html[lang="ja"] h2 { line-height: 1.3; }
html[lang="ja"] h3 { line-height: 1.45; }
.nums, td, .t-stat, .calc-out dd { font-variant-numeric: tabular-nums; }

/* skip link: first child of the header's .wrap, hidden until focused */
.skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; z-index: 20; background: var(--bg); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); }

/* ------------------------------------------------------------------ hero: the ledger window */
html[lang="ja"] .hero--centred .hero__lead { max-width: 34em; }
/* Japanese headlines run wide: the hero's words sit on the container's left line */
.hero--centred .hero__c { text-align: left; justify-items: start; margin-inline: 0; max-width: 900px; }
.hero--centred h1 { max-width: none; }
.hero--centred .btn-row { justify-content: flex-start; }

.ledger-win { background: #ffffff; color: var(--p-ink); border-radius: var(--r-lg); box-shadow: 0 24px 64px -24px rgba(20, 20, 20, .28); overflow: hidden; font-size: 14px; line-height: 1.5; text-align: left; }
.ledger-win__bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-5); background: #f3f6f9; font-size: 13px; color: var(--p-muted); }
.ledger-win__bar b { color: var(--p-ink); font-weight: 500; }
.ledger-win__bar .sp { flex: 1; }
.ledger-win__tabs { display: flex; gap: var(--s-5); padding: 0 var(--s-5); background: #f3f6f9; font-size: 13px; }
.ledger-win__tabs span { padding: var(--s-2) 0; color: var(--p-muted); }
.ledger-win__tabs span.is-on { color: var(--p-ink); box-shadow: inset 0 -2px 0 var(--p-accent); }
.ledger-win__body { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); padding: var(--s-5); }
.ledger-win__tile { background: #f3f6f9; border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: grid; gap: 2px; }
.ledger-win__tile small { font-size: 12px; color: var(--p-muted); }
.ledger-win__tile strong { font-family: var(--font-display); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ledger-win__tile.is-key { background: color-mix(in oklab, var(--p-accent) 12%, #ffffff); }
.ledger-win table { grid-column: 1 / -1; width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger-win th { text-align: left; font-weight: 500; color: var(--p-muted); padding: 6px 8px; background: #f3f6f9; }
.ledger-win td { padding: 6px 8px; box-shadow: inset 0 -1px 0 #e6ebf0; }
.ledger-win td.n, .ledger-win th.n { text-align: right; }
.ledger-win .ok { color: #1d7a4c; }
@media (max-width: 1023px) { .ledger-win__body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .ledger-win__body { padding: var(--s-4); gap: var(--s-2); }
  .ledger-win__tile strong { font-size: 18px; }
  .ledger-win table .hide-sm { display: none; }
  .ledger-win__bar .hide-sm { display: none; }
}

/* ------------------------------------------------------------------ homepage parts */
.split-copy > * + * { margin-top: var(--s-5); }
.facts-list { display: grid; gap: var(--s-4); padding: 0; list-style: none; }
.facts-list li { display: grid; gap: 2px; }
.facts-list b { font-weight: 500; }
.platform-rows .rows__value { color: var(--muted); }
.guide-rows a { display: contents; }
.rows__name { font-size: 17px; }
.faq .faq__item > h3 { font-size: 19px; }
.guide-rows li { cursor: pointer; }
.guide-rows li:hover .rows__name { text-decoration: underline; text-underline-offset: 4px; }

.carry-card { background: #ffffff; border-radius: var(--r-lg); padding: var(--s-6); display: grid; gap: var(--s-5); align-content: start; }
.carry-card h3 { font-size: var(--t-card); }
.carry-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.carry-flow div { background: #f3f6f9; border-radius: var(--r-md); padding: var(--s-4); display: grid; gap: var(--s-1); }
.carry-flow small { font-size: 13px; color: var(--muted); }
.carry-flow strong { font-family: var(--font-display); font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.carry-sum { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-5); font-size: 16px; }
.carry-sum dt { color: var(--ink); }
.carry-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.carry-sum .is-total { font-weight: 700; padding-top: var(--s-2); box-shadow: inset 0 1px 0 var(--line-strong); }
@media (max-width: 639px) { .carry-flow strong { font-size: 22px; } .carry-card { padding: var(--s-5); } }

/* ------------------------------------------------------------------ article pages (outside the screen rhythm) */
.doc { padding: calc(var(--nav) + var(--s-8)) 0 var(--s-9); }
.doc-head { display: grid; gap: var(--s-4); max-width: 820px; margin-bottom: var(--s-8); }
.doc-head h1 { font-size: clamp(30px, 1.9vw + 22px, 48px); line-height: 1.3; letter-spacing: 0; }
.doc-head .t-lead { color: var(--ink); max-width: 62ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: var(--t-label); color: var(--muted); padding: 0; list-style: none; }
.crumbs li + li::before { content: "／"; margin-right: var(--s-2); }
.crumbs a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.doc-meta { font-size: var(--t-label); color: var(--muted); }

.doc-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.doc-body { grid-column: 1 / span 8; max-width: 760px; }
.doc-side { grid-column: 10 / span 3; display: grid; gap: var(--s-5); }
@media (max-width: 1023px) { .doc-body, .doc-side { grid-column: 1 / -1; } .doc-side { margin-top: var(--s-8); } }

.doc-body > * + * { margin-top: var(--s-5); }
.doc-body h2 { font-size: clamp(24px, .8vw + 20px, 32px); margin-top: var(--s-9); scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.doc-body h3 { font-size: 20px; margin-top: var(--s-7); }
.doc-body h2 + *, .doc-body h3 + * { margin-top: var(--s-4); }
.doc-body p, .doc-body li { font-size: 17px; line-height: 1.9; }
.doc-body ul, .doc-body ol { padding-left: 1.4em; display: grid; gap: var(--s-2); }
.doc-body a:not(.btn) { text-decoration: underline; text-decoration-color: var(--action); text-underline-offset: 4px; color: var(--ink); }
.doc-body a:not(.btn):hover { text-decoration-thickness: 2px; }
.doc-body strong { font-weight: 700; }
.doc-body .tablebox { overflow-x: auto; background: var(--p-surface); border-radius: var(--r-md); }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.doc-body th, .doc-body td { padding: var(--s-3) var(--s-4); text-align: left; vertical-align: top; box-shadow: inset 0 -1px 0 var(--line); }
.doc-body th { font-weight: 500; }
.doc-body thead th { background: color-mix(in oklab, var(--p-surface) 70%, var(--p-ink) 6%); }
.doc-body td.n, .doc-body th.n { text-align: right; white-space: nowrap; }
.doc-body tr:last-child > * { box-shadow: none; }

/* a note is a tone step, never a bordered box */
.note { background: var(--p-surface); border-radius: var(--r-md); padding: var(--s-5) var(--s-6); }
.note > * + * { margin-top: var(--s-3); }
.note p, .note li { font-size: 16px; }
.note h3, .note .note__title { font-size: 17px; font-weight: 700; margin: 0; }
.formula { background: #ffffff; border-radius: var(--r-md); padding: var(--s-5) var(--s-6); font-size: 18px; line-height: 1.8; }
.formula b { font-weight: 700; }

.toc { background: var(--p-surface); border-radius: var(--r-md); padding: var(--s-5); }
.toc p { font-size: var(--t-label); color: var(--muted); margin-bottom: var(--s-3); }
.toc ol { margin: 0; padding-left: 1.3em; display: grid; gap: var(--s-2); font-size: 15px; line-height: 1.6; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.side-card { background: #ffffff; border-radius: var(--r-lg); padding: var(--s-5); display: grid; gap: var(--s-3); }
.side-card h2 { font-size: 18px; line-height: 1.5; }
.side-card p { font-size: 15px; line-height: 1.7; }
.side-card .btn { width: 100%; }

.doc-photo { margin: var(--s-7) 0; border-radius: var(--r-lg); overflow: hidden; }
.doc-photo img { display: block; width: 100%; height: auto; }

.sources { font-size: 15px; }
.sources li { font-size: 15px; line-height: 1.7; }
.disclaimer { margin-top: var(--s-9); font-size: 14px; line-height: 1.8; color: var(--ink); background: var(--p-surface); border-radius: var(--r-md); padding: var(--s-5) var(--s-6); }
.faq-list { display: grid; gap: var(--s-6); }
.faq-list h3 { font-size: 18px; margin: 0; }
.faq-list p { margin-top: var(--s-2); }
.next-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); padding: 0; list-style: none; }
.next-links a { display: grid; gap: var(--s-1); background: #ffffff; border-radius: var(--r-md); padding: var(--s-5); text-decoration: none !important; transition: transform var(--dur) var(--ease); }
.next-links a:hover { transform: translateY(-2px); }
.next-links b { font-weight: 700; font-size: 17px; }
.next-links span { font-size: 15px; line-height: 1.6; color: var(--ink); }
@media (max-width: 639px) { .next-links { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ the calculator */
.calc { background: #ffffff; border-radius: var(--r-lg); padding: var(--s-6); display: grid; gap: var(--s-6); }
.calc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.calc-form .field-wide { grid-column: 1 / -1; }
.calc label, .calc legend { display: block; font-size: var(--t-label); font-weight: 500; margin-bottom: var(--s-2); }
.calc input[type=number], .calc select { width: 100%; height: 48px; padding: 0 var(--s-4); font: 400 16px/1 var(--font-text); color: var(--ink); background: #f3f6f9; border: 1px solid transparent; border-radius: var(--r-sm); }
.calc input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
.calc input:focus-visible, .calc select:focus-visible { outline: 2px solid var(--action); outline-offset: 1px; }
.calc fieldset { border: 0; padding: 0; margin: 0; }
.calc .choice { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.calc .choice label { margin: 0; display: inline-flex; align-items: center; gap: var(--s-2); height: 44px; padding: 0 var(--s-4); border-radius: var(--r-sm); background: #f3f6f9; font-size: 15px; font-weight: 400; cursor: pointer; }
.calc .choice input { accent-color: var(--action); }
.calc .choice label:has(input:checked) { background: color-mix(in oklab, var(--action) 14%, #ffffff); font-weight: 500; }
.calc .hint { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: var(--s-2); }
.calc-out { background: #f3f6f9; border-radius: var(--r-md); padding: var(--s-5) var(--s-6); display: grid; grid-template-columns: 1fr auto; gap: var(--s-3) var(--s-6); margin: 0; }
.calc-out dt { font-size: 16px; }
.calc-out dd { margin: 0; text-align: right; font-size: 18px; font-weight: 500; }
.calc-out .is-key dt, .calc-out .is-key dd { font-weight: 700; }
.calc-out .is-key { display: contents; }
.calc-out dd.big { font-family: var(--font-display); font-size: 32px; }
.calc-note { font-size: 14px; line-height: 1.7; color: var(--ink); }
@media (max-width: 639px) { .calc { padding: var(--s-5); } .calc-form { grid-template-columns: 1fr; } .calc-out { padding: var(--s-4); } .calc-out dd.big { font-size: 26px; } }

/* the check card (a fragment of the ledger's warning list) */
.check-list { list-style: none; padding: 0; display: grid; gap: var(--s-3); }
.check-list li { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: start; background: #f3f6f9; border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-size: 15px; line-height: 1.6; }
.check-list b { font-size: 13px; font-weight: 500; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.check-list b.warn { background: #fbf0dc; color: #6e4200; }
.check-list b.ok { background: #e3f3ea; color: #155c39; }
.hero--centred .hero__window > .ly-piece.ledger-win { width: min(980px, calc(100% - 2 * var(--s-6))); }
@media (max-width: 639px) { .hero--centred .hero__window > .ly-piece.ledger-win { left: 0; width: 100%; } }

@media (max-width: 639px) {
  .ledger-win__tabs, .ledger-win table { display: none; }
  .ledger-win__bar { padding: var(--s-2) var(--s-4); }
  .ledger-win__tile { padding: var(--s-2) var(--s-3); }
  html[lang="ja"] .hero h1 { font-size: 32px; }
  .rows > li { grid-template-columns: minmax(0, 1fr); }
  .rows > li .rows__value { grid-column: 1; grid-row: auto; text-align: left; color: var(--muted); font-size: 14px; }
}
.doc-body > :first-child { margin-top: 0; }
@media (max-width: 639px) { .doc-head { margin-bottom: var(--s-7); } .doc { padding-top: calc(var(--nav) + var(--s-6)); } }

.guides-cta { margin-top: var(--s-6); }
@media (max-width: 1023px) {
  main .grid.fill > .frame--fill { flex: none; height: auto; aspect-ratio: 4 / 3; min-height: 0; }
}
@media (max-width: 639px) { .hero .pill { display: none; } }
#guides .frame--fill { height: auto; aspect-ratio: 4 / 3; flex: none; min-height: 0; }
