/* explain_l3.css — lane 3 (Explain) own stylesheet: UX step 1 (29-Oct-2026, research/RESEARCH_l3_explain_ux.md §7 Step 1; test_l3_ux1.js).
   Loaded on every screen after app.css / ui.css (mod_l3.json "css"), so these rules win over the older ones in app.css without editing it.
   Nothing here removes a control: it is hidden on a touch screen, folded behind "⋯", or made bigger. */

/* ---- Rx section 10: each topic is one 44 px chip (tick = print it) with its own 44 x 44 ▶ (show it) — UX-M1 ---- */
.xpbox .xpticks { gap: 8px; }
.xpbox .xptick { gap: 0; border: 1px solid #c9d3dc; border-radius: 22px; background: #fff; overflow: hidden; }
.xpbox .xptick label { min-height: 44px; padding: 0 10px 0 12px; gap: 8px; font-size: 15px; cursor: pointer; }
.xpbox .xptick input[type=checkbox] { width: 20px; height: 20px; }
.xpbox .xptick .xpgo { min-width: 44px; min-height: 44px; height: 44px; padding: 0; margin: 0; border: 0; border-left: 1px solid #c9d3dc; border-radius: 0; font-size: 16px; line-height: 44px; }
.xpbox .xpticks [data-xall] { min-height: 44px; border-radius: 22px; padding: 0 16px; }
.xpbox .xpsub select { min-height: 44px; font-size: 15px; }

/* ---- the slide page (/?p=explainshow) ---- */
/* the slide fits under the bar, whatever the bar's height (explain.js sets --xpbar; 0 in pseudo full screen) — no cut-off, no page scroll */
body.xpshow .xslide { width: min(100vw, calc((100dvh - var(--xpbar, 52px)) * 16 / 9)); }
body.xpshow .xpnav .xptabs { display: contents; }
/* desktop: "⋯" is not needed — Text page and Full screen stay in the bar as before */
#xpmorebtn { display: none; }
.xpmore .xpmenu { display: contents; }
/* the dots are buttons now (jump to a slide); the dot is drawn inside a larger tap area */
.xpnav .xsdots { gap: 0; }
.xpnav .xsdots button { display: grid; place-items: center; width: 28px; height: 28px; min-width: 0; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.xpnav .xsdots button::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #ccc; }
.xpnav .xsdots button.on { background: none; border: 0; } .xpnav .xsdots button.on::before { background: #1f4e79; }
.xpnav .xsdots button:focus-visible { outline: 2px solid #1f4e79; outline-offset: -2px; }

/* touch screens: the desk's key line and the slide code are for the doctor at a keyboard — hidden (not removed); "⋯" holds Text page + Full screen.
   The patient's own link (pxshow) keeps its tap hint. */
@media (pointer: coarse) {
  body.xpshow:not(.pxshow) .xpnav .xpkeys, body.xpshow .xslide .xsno { display: none; }
  .xpnav .xsdots { overflow-x: auto; scrollbar-width: none; }
  .xpnav .xsdots button { width: 44px; height: 44px; flex: none; }
  body.xpshow .xpnav .xptabs button { min-height: 44px; }
  #xpmorebtn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; font-size: 22px; line-height: 1; }
  .xpmore { position: relative; margin-left: auto; }
  .xpmore .xpmenu { display: none; }
  .xpmore.open .xpmenu { display: flex; flex-direction: column; gap: 6px; position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; min-width: 190px; padding: 8px;
    background: #fff; border: 1px solid #c9d3dc; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
  .xpmore .xpmenu button { min-height: 44px; width: 100%; text-align: left; }
}

/* phones and small tablets: a compact bar — the topics scroll in one row with "⋯" at its end, the dots under them */
@media (max-width: 600px), (max-height: 500px) {
  body.xpshow .xpnav { padding: 4px 8px; gap: 4px 6px; flex-wrap: wrap; }
  body.xpshow .xpnav .xptabs { display: flex; gap: 6px; order: 1; flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  body.xpshow .xpnav .xptabs button { flex: none; font-size: 15px; padding: 0 12px; white-space: nowrap; }
  body.xpshow .xpnav .xpmore { order: 2; }
  body.xpshow .xpnav .xpdraftb { order: 3; flex-basis: 100%; }
  body.xpshow .xpnav .xsdots { order: 4; flex-basis: 100%; justify-content: center; margin: 0; }
  body.xpshow.pxshow .xpnav .xpkeys { order: 5; }
  /* the smallest words on a slide stay readable (they are sized to the slide's width, which was 5 px on a 390 px phone) */
  body.xpshow .xslide .xkick { font-size: max(12px, 1.35cqw); }
  body.xpshow .xslide .xhead { font-size: max(24px, 4.4cqw); }
  body.xpshow .xslide .xcap { font-size: max(15px, 2.25cqw); }
  body.xpshow .xslide.xr .xcap { font-size: max(15px, 1.9cqw); margin: 0 4cqw 2cqw; }
  body.xpshow .xslide .xssrc { font-size: max(12px, 1cqw); position: static; max-width: none; margin: 0 4cqw 1.4cqw; }
}
/* a phone on its side: the bar is one row (topics · dots · ⋯), the slide is fitted by height */
@media (max-height: 500px) and (orientation: landscape) {
  body.xpshow .xpnav { flex-wrap: nowrap; padding: 2px 8px; }
  body.xpshow .xpnav .xsdots { order: 2; flex: none; flex-basis: auto; }
  body.xpshow .xpnav .xpmore { order: 3; margin-left: 0; }
}
/* a phone held upright: the slide takes the whole screen under the bar (not a 16:9 strip a quarter of the screen high); the picture grows into it */
@media (orientation: portrait) and (max-width: 600px) {
  body.xpshow .xslide { aspect-ratio: auto; width: 100vw; height: calc(100dvh - var(--xpbar, 100px)); }
  body.xpshow .xslide .xart { padding: 0 2vw; }
}

/* pseudo full screen (body.xpfull, set by explain.js where the Fullscreen API is missing, e.g. iPhone): the bar floats over the slide and fades */
body.xpshow.xpfull.xsmode { overflow: hidden; }
body.xpfull .xpnav { position: fixed; top: 0; left: 0; right: 0; transition: opacity .3s; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
body.xpfull.xpnavoff .xpnav { opacity: 0; pointer-events: none; }
body.xpfull .xslides { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
body.xpfull .xpscreen { margin-top: 0; }
