/* ───────────── every form factor: phones from 320 px, foldables (cover, open, book posture), tablets, desktops ─────────────
   rules_design_review, 28-Oct-2026. The viewport meta carries viewport-fit=cover; see directory-blueprint/design/FOLD-LAYER.md. */
h1, h2, h3 { overflow-wrap: anywhere; }

/* the bar never sticks (the owner's standing rule: no sticky header on any site) */
.bar { position: relative; }

/* safe areas: notches, rounded corners and the home bar */
.wrap { width: min(var(--wrap), 100% - max(20px, env(safe-area-inset-left)) - max(20px, env(safe-area-inset-right))); }
@media (max-width: 640px) { .wrap { width: calc(100% - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right))); } }
.foot-base { padding-bottom: max(26px, env(safe-area-inset-bottom)); }

/* touch: every target at least 44 px (links inside sentences excepted) */
@media (pointer: coarse) {
  .word { min-height: 44px; }
  .mode { width: 44px; height: 44px; }
  .btn.sm, .bar .btn { min-height: 44px; }
  .bar nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .seek input { height: 44px; }
  .foot ul { gap: 0; }
  .foot ul a, .foot-base a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .foot-base { gap: 0 22px; }
  .crumbs a { display: inline-block; padding: 12px 3px; margin: -12px -3px; }
  aside li a { display: inline-block; padding-block: 12px; margin-block: -12px; }
}

/* book posture (a foldable half-open like a book): nothing across the fold */
@media (horizontal-viewport-segments: 2) {
  :root { --seg0: env(viewport-segment-width 0 0, 50vw); --fold-gap: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px) + 32px); --fold-page: calc(var(--seg0) - 32px); }
  .wrap { width: calc(100% - 32px); }
  .foot-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--fold-gap); }
}
