/* AMAADOR Chemical Safety Studio — r7 polish layer (2026-11-26).
   Loaded after r6. Phone tap targets and reading size, light-mode contrast on small chips,
   compact hero on phones so the tool starts sooner, no clipped tab labels.
   Delete this file (and its <link>) to fall back to r6. */

/* ---------- 1. Small text never under 11.5px ---------- */
#chem-pro-app .cp-pill-pro.cp-pill-pro,
#chem-pro-app .cp-kicker.cp-kicker,
#chem-pro-app .cp-next-tip.cp-next-tip,
#chem-pro-app .cp-nav-cnt.cp-nav-cnt,
#chem-pro-app .cp-badge.cp-badge,
#chem-pro-app .cp-field > span { font-size: 11.5px; }
/* list badges carry an inline .63rem from the renderer */
#chem-pro-app .cp-item-right .cp-badge { font-size: 11px !important; }
#chem-pro-app .cp-kicker { letter-spacing: .08em; }

/* ---------- 2. Light mode: small chips reach readable contrast ---------- */
html:not([data-theme=dark]) #chem-pro-app { --cp-mu: #526072; } /* was #64748b: 4.4:1 on soft panels, now about 5.8:1 */
html:not([data-theme=dark]) #chem-pro-app .cp-pill-pro,
html:not([data-theme=dark]) #chem-pro-app .cp-next-n,
html:not([data-theme=dark]) #chem-pro-app .cp-nav-cnt,
html:not([data-theme=dark]) #chem-pro-app .cp-badge,
html:not([data-theme=dark]) #chem-pro-app .cp-score-chip {
  color: color-mix(in srgb, currentColor 62%, #000);
}
html:not([data-theme=dark]) #chem-pro-app .cp-item-meta,
html:not([data-theme=dark]) #chem-pro-app .cp-nav-sec { color: #4b5563; }

/* ---------- 3. Segmented tabs: labels never clipped ---------- */
#chem-pro-app .cp-seg { flex-wrap: wrap; row-gap: 6px; }
#chem-pro-app .cp-seg > button { white-space: nowrap; overflow: visible; text-overflow: clip; max-width: none; }

/* ---------- 4. Phones ---------- */
@media (max-width: 640px) {
  /* comfortable tap targets */
  #chem-pro-app .cp-btn,
  #chem-pro-app .cp-nav-btn,
  #chem-pro-app .cp-seg > button { min-height: 40px; }
  #chem-pro-app button.cp-badge { min-height: 32px; }
  #chem-pro-app .cp-btn:not(:has(span)) { min-width: 40px; }
  /* tabs scroll sideways instead of wrapping into a wall of chips */
  #chem-pro-app .cp-seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  #chem-pro-app .cp-seg::-webkit-scrollbar { display: none; }
  #chem-pro-app .cp-seg > button { flex: 0 0 auto; scroll-snap-align: start; }
  /* form fields at 16px so iOS does not zoom on focus */
  #chem-pro-app input, #chem-pro-app select, #chem-pro-app textarea { font-size: 16px; }

  /* compact hero: the studio starts about one screen sooner */
  .r2-sx-hero { padding-block: 20px 12px; }
  .r2-sx-hero .r2-sx-stats { gap: 8px; margin-top: 14px; }
  .r2-sx-hero .r2-sx-stats > div { padding: 10px 12px; border-radius: 14px; }
  .r2-sx-hero .r2-sx-stats dt { font-size: 12px; line-height: 1.3; }
  .r2-sx-hero .r2-sx-stats dd { font-size: 22px; margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  #chem-pro-app .cp-seg { scroll-behavior: auto; }
}
