/* mobile-polish.css - linked by every page, right after touch-fields.css.
 * Phone-width finish only (max-width 700px), so desktop is unchanged. Nothing here adds a blur,
 * filter, blend mode or animation: iPhone Safari counts every extra layer against the tab. */
@media (max-width: 700px) {
  html { -webkit-tap-highlight-color: rgba(55, 230, 208, .14); }

  /* "Sample · synthetic demo data" strips: one calm size on every page. The decorative dots
     wrapped onto lines of their own on a phone and read as stray bullets. */
  .sample-banner { font-size: 10.5px !important; letter-spacing: .1em !important; line-height: 1.5 !important;
    padding: 8px 18px !important; min-height: 0 !important; gap: 6px !important; flex-wrap: wrap !important; }
  .sample-banner .dot { display: none !important; }

  /* The demo ribbon on the body-area pages sits in the page flow at the top instead of floating
     over the title and the back link; same words, smaller type, amber on dark. */
  #hx-demo-ribbon { position: sticky !important; top: 0; font-size: 10.5px !important; letter-spacing: .08em !important;
    line-height: 1.5 !important; padding: 8px 16px !important; gap: 2px 8px !important;
    background: linear-gradient(90deg, rgba(56, 18, 26, .98), rgba(50, 28, 10, .98)) !important;
    border-bottom-color: rgba(246, 189, 124, .35) !important; color: #ffe2c4 !important; }
  #hx-demo-ribbon a { display: inline-block; padding: 8px 4px; margin: -8px 0; }
  body:has(> #hx-demo-ribbon) { margin-top: 0 !important; }

  /* Inside the gallery the "All views" link would open a second gallery inside the frame; the
     gallery's own Views button is right above it. Standalone, the link gets a finger-sized target. */
  .helix-embedded a.back[href*="gallery.html"] { display: none !important; }
  a.back { display: inline-block; padding-top: 12px; padding-bottom: 12px; margin-top: -12px; margin-bottom: -12px; }

  /* Chart captions: a long date range ("2024-12-15 → 2026-06-08") right-aligned in a narrow card
     broke mid-date and ran past the card edge. */
  .viz-cap .say { text-align: left !important; max-width: none !important; font-size: .92rem !important; overflow-wrap: anywhere; }

  /* Finger-sized controls (Apple's 44 pt guideline) without moving the layout. */
  button[data-range] { min-height: 40px; }
  input[type="checkbox"]:not([switch]) { width: 20px; height: 20px; accent-color: #37e6d0; }
  .lensrow a { display: inline-block; padding-top: 12px; padding-bottom: 12px; margin-top: -12px; margin-bottom: -12px; }

  /* Medicines: its action buttons were 30 px tall. */
  .med-btn, .med-note button { min-height: 44px; padding-left: 16px; padding-right: 16px; }

  /* Dashboard header: three chips wrapped to a ragged second line beside the logo; "Local-first" repeats the
     "Private · analysed on-device" bar above it, so phones keep "Make it mine" and "On-device". */
  .nav-right:has(#wizardOpen) > .chip:not(.wizard-open):not(.lock) { display: none !important; }

  /* Briefing: an empty disclaimer box drew a stray rule under the lede. */
  .pg > #disc:empty { display: none; }
  #sampleLink { display: inline-block; margin-right: 18px; }

  /* Round 2 tap targets (Apple's 44 pt): invisible hit areas, so the layout and the look stay as they were. */
  .hdr-link, .energy-link, .assess-lede a, .glass.empty a, .card p > a[href="./composition.html"] { position: relative; }
  .hdr-link::after, .energy-link::after, .assess-lede a::after, .glass.empty a::after,
  .card p > a[href="./composition.html"]::after { content: ""; position: absolute; inset: -12px -4px; }
  .cx-links a { display: inline-block; padding-top: 13px; padding-bottom: 13px; margin-top: -13px; margin-bottom: -13px; }
  .radial-stage[data-mode="compact"] .rnode::after { content: ""; position: absolute; inset: -14px -11px; }
  .abstain-chip { min-height: 44px; display: inline-flex; align-items: center; }
  details.abstain-wrap > summary, details.recheck-more > summary { padding-top: 12px; padding-bottom: 12px; }
  .seg button { min-height: 40px; }
  .dob-input { min-height: 44px; }
  a.pill::after { inset: -12px -6px; }

  /* Concept pages: the floating "How to read your scan" cue wrapped to two lines between the All views and Share
     pills at 375 px. It now sits one line above them. */
  .ldk-cue-btn { white-space: nowrap; min-height: 44px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }

  /* Momentum scrolling and no rubber-band sideways drift in scrolling strips. */
  [style*="overflow-x:auto"], [style*="overflow-x: auto"] { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
}
@media (max-width: 400px) {
  /* At 375-400 px even two chips wrapped under the logo; "Make it mine" is the one that does something. */
  .nav-right:has(#wizardOpen) > .chip.lock { display: none !important; }
}
