/* Two tabs side by side on a wide touch screen (duo.js): iPhone Duo opened and held on its side,
   and a folding Android. body.duo is set only while the page is split. Each half is a phone:
   the questions the other styles ask about the screen's width are answered with the width of a
   half (duo.js), so nothing in a half needs styles of its own here. */
body.duo { overflow: hidden; }
body.duo .shell {
  max-width: none;
  height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 0;
}
body.duo .masthead { padding-inline: max(var(--space-4), env(safe-area-inset-left)) max(var(--space-4), env(safe-area-inset-right)); padding-bottom: var(--space-3); }
body.duo .shell > .banner { margin-inline: var(--space-4); }
body.duo #main { flex: 1; min-height: 0; overflow: visible; }
body.duo footer { display: none; }
/* The halves meet on the fold. Where the screen says where its fold is (viewport segments),
   the left half is exactly the left part of the screen; elsewhere the fold is the middle. */
.duo-split {
  display: grid;
  grid-template-columns: env(viewport-segment-width 0 0, 1fr) minmax(0, 1fr);
  height: 100%;
}
/* What a page pins to the screen (Mentor's writing field, its statue) is pinned to its own half. */
.duo-pane { position: relative; contain: layout; min-width: 0; overflow: hidden; }
.duo-pane + .duo-pane { border-inline-start: 1px solid var(--border); }
.duo-scroll {
  position: relative;
  isolation: isolate;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: 150px;
  padding: 0 var(--space-4) calc(112px + env(safe-area-inset-bottom));
}
.duo-pane:first-child .duo-scroll { padding-inline-start: max(var(--space-4), env(safe-area-inset-left)); }
.duo-pane:last-child .duo-scroll { padding-inline-end: max(var(--space-4), env(safe-area-inset-right)); }
/* The page beside the one you are on is marked in the menu too, more quietly: a line under it. */
.tabs button.duo-beside { box-shadow: inset 0 -2px 0 var(--accent-soft); }
/* A sheet lies over one half, never across the fold. The first tour and the guide are the whole screen's. */
body.duo dialog:modal:not(#intro-dialog, #guide-dialog) { max-width: calc(50vw - 24px); }
body.duo[data-duo-half="v"] dialog:modal:not(#intro-dialog, #guide-dialog) { margin-inline-start: 12px; margin-inline-end: auto; }
body.duo[data-duo-half="h"] dialog:modal:not(#intro-dialog, #guide-dialog) { margin-inline-end: 12px; margin-inline-start: auto; }
.duo-toggle[hidden] { display: none; }
.duo-toggle[aria-pressed="true"] { color: var(--accent-strong); }
body.duo:has(dialog.workout-dialog[open]) .wo-resume { display: none; }
