/* Review layout: a fluid visual canvas and a separate Japanese reading measure.
   Width owns line length; original type size, tracking and alignment stay intact. */
html[data-natural-preview] {
  --max: 90rem;
  --reading: 46rem;
  --side: clamp(20px, 4.8vw, 88px);
  --preview-canvas: 90rem;
  --preview-measure: calc(var(--jp-body-size, 1rem) * 38);
}
html[data-natural-preview] body {
  inline-size: 100%;
  max-inline-size: 100%;
}
/* Keep photographs, diagrams and multi-column layouts wider than prose. */
html[data-natural-preview] body :is(.section-inner,.hero-inner,.page-hero-inner,.footer-inner,.contact-inner,.services-page-hero-inner,.price-section-inner,.production-conditions-inner,.yk-record-hero-inner,.yk-record-grid) {
  inline-size: 100%;
  max-inline-size: var(--preview-canvas);
}
html[data-natural-preview] body .consultation-shell {
  inline-size: 100%;
  max-inline-size: 62rem;
}
html[data-natural-preview] body .privacy-shell {
  inline-size: 100%;
  max-inline-size: 74rem;
}
html[data-natural-preview] body .kcd-unified-inner {
  inline-size: 100%;
  max-inline-size: 60rem;
}
/* Nested reading areas use 100% of their parent, never repeated percentages.
   The em-based measure grows with the existing body scale, up to about 38
   Japanese glyphs; the viewport remains the first limit on small screens.
   max-inline-size:none leaves the tail fitter its small, measured allowance. */
html[data-natural-preview] body :is(.content-body,.body-copy,.understanding-prose,.reading-panel,.fuku-place-trace-copy,.kcd-unified-description,.consultation-quick-inner) {
  inline-size: min(100%, var(--preview-measure));
  max-inline-size: none;
}
html[data-natural-preview] body .form-record {
  --fr-side: clamp(20px, 4.8vw, 88px);
  --preview-measure: calc(var(--jp-body-size) * 38);
}
html[data-natural-preview] body .form-record .fr-inner {
  inline-size: 100%;
  max-inline-size: var(--preview-canvas);
}
html[data-natural-preview] body .form-record :is(.fr-reading,.fr-diagram-note,.fr-act2-copy,.fr-act2-summary-copy,.fr-act2-ending,.fr-position-copy,.fr-world-emerges-copy,.fr-forest-depth-copy,.fr-branch-copy,.fr-ground-copy) {
  inline-size: min(100%, var(--preview-measure));
  max-inline-size: none;
}
/* Columns need readable text measures, not merely zero document overflow. */
html[data-natural-preview] body .content-grid {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(48px, 5vw, 80px);
}
html[data-natural-preview] body .condition-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
}
@media (max-width: 1199px) {
  html[data-natural-preview] body :is(.content-grid,.intro-grid,.method-head,.scope-grid,.yk-object-grid,.yk-record-link,.price-section-inner,.service-overview-head),
  html[data-natural-preview] body .production-conditions header {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 1279px) {
  html[data-natural-preview] body :is(.fuku-statement-inner,.fuku-section-head,.fuku-lineage-head,.fuku-old-photo-grid) {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* These standalone utilities have their own viewing purpose. */
html[data-natural-preview] body .card-shell {
  inline-size: 100%;
  max-inline-size: 430px;
}
html[data-natural-preview] body.time-sphere-page .wrap {
  inline-size: calc(100% - clamp(19px, 3.6vw, 72px) * 2);
  max-inline-size: 81.25rem;
}
html[data-natural-preview] body [data-jp][data-natural-prose] {
  inline-size: min(100%, 38em);
  max-inline-size: none;
  min-inline-size: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  line-break: strict;
  text-wrap: wrap;
}
/* Gentle line balancing for phones and tablets: avoids isolated final
   kana before punctuation, while retaining desktop (1200px+) lineation. */
@media (max-width: 1199px) {
  html[data-natural-preview] body [data-jp][data-natural-prose] {
    text-wrap: pretty;
  }
}
html[data-natural-preview] body [data-natural-prose]:is([data-jp="note"],[data-jp="caption"]) {
  inline-size: min(100%, 50em);
}
html[data-natural-preview] body.time-sphere-page :is(.sphere-map-note,.interact-tip) {
  margin-inline: auto;
}
/* A shared reading frame gives its paragraphs the same edges. */
html[data-natural-preview] body :is(.content-body,.body-copy,.understanding-prose,.reading-panel,.fuku-place-trace-copy,.kcd-unified-description,.consultation-quick-inner,.fr-reading,.fr-diagram-note,.fr-act2-copy,.fr-act2-summary-copy,.fr-act2-ending,.fr-position-copy,.fr-world-emerges-copy,.fr-forest-depth-copy,.fr-branch-copy,.fr-ground-copy) [data-natural-prose] {
  inline-size: 100%;
}
html[data-natural-preview] body [data-natural-prose] :is(span,a,strong,em,small) {
  white-space: normal;
  word-break: normal;
  overflow-wrap: inherit;
}
html[data-natural-preview] body [data-natural-prose] span { display: inline; }
@media (max-width: 560px) {
  html[data-natural-preview] { --side: 20px; }
  html[data-natural-preview] body .form-record { --fr-side: clamp(20px, 5.6vw, 24px); }
}
/* A long book title can exceed a tablet line. Use native Japanese kinsoku
   instead of keep-all's emergency break, which Safari may put before a comma. */
@media (max-width: 900px) {
  html[data-natural-preview] body .yk-record-hero h1[data-jp] {
    word-break: normal;
    overflow-wrap: normal;
    line-break: strict;
  }
}
