/* Site-wide reading scale. Loaded after section styles, including Rita's office.
   Apple HIG uses 17 pt as the default iOS body size (not a CSS conversion).
   WithRita deliberately uses a roomier 19 CSS px reading size and rem units.
   Legacy component sizes use --wr-type-min so specificity cannot shrink text.
   Native app styles and generated PDFs are separate and are not changed here. */
:root {
  --wr-text-body: 1.1875rem;
  --wr-text-control: 1.125rem;
  --wr-text-note: 1rem;
  --wr-type-min: var(--wr-text-note);
}

html { font-size: 100%; }
body { font-size: var(--wr-text-body); line-height: 1.6; }

:where(p, li, dd, blockquote) {
  --wr-type-min: var(--wr-text-body);
  font-size: var(--wr-type-min);
  overflow-wrap: break-word;
}
:where(small, dt, figcaption, time, .eyebrow, .office-meta, .notification-context) {
  --wr-type-min: var(--wr-text-note);
  font-size: var(--wr-type-min);
  line-height: 1.5;
}
:where(button, input, select, textarea, label, legend, summary,
       .button, .catalog-outline-button, .text-link, .whatsapp-button) {
  --wr-type-min: var(--wr-text-control);
  font-size: var(--wr-type-min);
}
:where(h1) { --wr-type-min: 2rem; }
:where(h2) { --wr-type-min: 1.5rem; }
:where(h3, h4, h5, h6) { --wr-type-min: 1.3125rem; }

/* These are explanations, not footnotes, even where older markup used small. */
:is(.space-card-copy, .dashboard-rita-pocket-card, .dashboard-help-card,
    .rita-tool-copy, .nutrition-tool-list, .office-link-card) small {
  --wr-type-min: var(--wr-text-body);
  font-size: var(--wr-text-body);
  line-height: 1.6;
}
.office-page { font-size: var(--wr-text-body); }
.office-brand small { font-size: var(--wr-text-note); }
.eyebrow { letter-spacing: .08em; }
.plan-notification strong { --wr-type-min: 1.25rem; }
.welcome-hero__lead { font-size: max(var(--wr-text-body), clamp(1.05rem, 2.2vw, 1.25rem)); }

/* Let controls and cards grow with their labels; never hide readable text. */
:is(.button, .catalog-outline-button, .whatsapp-button) {
  min-height: 48px;
  height: auto;
  max-width: 100%;
  padding-block: 12px;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}
:where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
}
:where(.space-card-copy, .plan-notification > div, .notification-heading > div,
       .dashboard-section-heading > div, .office-client-row > div) { min-width: 0; }
.space-card { grid-template-columns: 48px minmax(0,1fr) auto; }
.space-card-resume, .section-status, .pdf-plan-status, .office-domain {
  max-width: 100%;
  width: fit-content;
  white-space: normal;
  overflow-wrap: anywhere;
}
.notification-heading, .plan-notification, .membership-explainer summary,
.office-task-bottom { flex-wrap: wrap; }
.main-nav > a:not(.button), .nav-logout button { min-height: 44px; }
button.text-link, button.text-button, button.destructive-text-button {
  min-height: 44px; padding-block: 10px; white-space: normal;
}
.context-info-trigger, .context-info-dialog-close, .nutrition-info-dialog-close {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
}
.catalog-service-card:has(.service-info-trigger) { padding-top: 65px; }
.office-navigation a { overflow-wrap: anywhere; }
.service-rita-photo { min-width: 0; width: 100%; }
/* Help text stays readable, and enlarged text can reflow inside older grids. */
main small { --wr-type-min: var(--wr-text-control); font-size: var(--wr-text-control); }
main :where(section, article, div, form, fieldset, header, aside, nav, details, label) {
  min-inline-size: 0;
}
main :where(a, span, strong, em, p, li, ul, ol, figcaption) {
  min-inline-size: 0; overflow-wrap: anywhere;
}
main :where(h1, h2, h3, h4, legend, label, summary, .text-link, .space-card-copy) {
  overflow-wrap: anywhere;
}
main fieldset { max-inline-size: 100%; }
.space-card-copy > * { min-width: 0; overflow-wrap: anywhere; }
.auth-section { grid-template-columns: minmax(0,1fr); }
.account-details { overflow-wrap: anywhere; }
.donna-back-link, .donna-instagram-link, .donna-status {
  max-width: 100%; white-space: normal; overflow-wrap: anywhere;
}
.donna-instagram-link { flex-wrap: wrap; }
.text-link { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.event-more-image span { overflow-wrap: anywhere; }
.legal-section-body a { overflow-wrap: anywhere; }
.legal-socials a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.legal-summary ul { min-width: 0; grid-template-columns: minmax(0,1fr); }
.event-process-grid > li { min-width: 0; }
.donna-price-list > div { flex-wrap: wrap; }
.nutrition-path-price { flex-wrap: wrap; }
.nutrition-path ul { grid-template-columns: minmax(0,1fr); }
.rita-tool-card { grid-template-columns: 43px minmax(0,1fr); }
.studio-module { grid-template-columns: 42px minmax(0,1fr); }
.nutrition-practical-reference .nutrition-reference-visual figcaption {
  font-size: var(--wr-text-control);
}
main [aria-hidden="true"] { flex-shrink: 0; }
.event-faq-list summary { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.event-text-link, .app-support-side nav a, .card-primary-link,
.nutrition-compass-guide-tools > a, .nutrition-compass-access > a {
  display: inline-block; max-width: 100%; white-space: normal;
}
.dashboard-rita-pocket-card { grid-template-columns: 45px minmax(0,1fr) auto; }
.dashboard-help-card { grid-template-columns: 43px minmax(0,1fr) auto; }
.dashboard-help-card > span, .dashboard-rita-pocket-card > span { min-width: 0; overflow-wrap: anywhere; }
.card-primary-link { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.pdf-plan-intake-form :is(input, select) { min-width: 0; }
@media (max-width: 699px) {
  .event-process-grid { grid-template-columns: minmax(0,1fr); }
  .pdf-plan-intake-grid { grid-template-columns: minmax(0,1fr); }
  .dashboard-help-card { grid-template-columns: 43px minmax(0,1fr); }
  .dashboard-help-card em { grid-column: 2; }
}
.wardrobe-card-actions { flex-wrap: wrap; gap: 10px; }
.wardrobe-card-actions > form { min-width: 0; max-width: 100%; }
.wardrobe-card-actions :is(a, button) { display: inline-flex; align-items: center;
  min-height: 44px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Keep the complete menu available before larger labels run out of room. */
@media (min-width: 960px) and (max-width: 1279px) {
  .site-header .menu-button { display: grid; }
  .site-header .main-nav { display: none; position: absolute; left: 18px; right: 18px;
    top: 74px; padding: 22px; border: 1px solid var(--line); border-radius: 24px;
    box-shadow: var(--shadow); background: var(--white); flex-direction: column;
    align-items: stretch; gap: 14px; }
  .site-header .main-nav.is-open { display: flex; }
}
@media (min-width: 1280px) {
  .site-header .main-nav { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
  .site-header .nav-wrap { gap: 24px; padding-block: 12px; }
}
@media (max-width: 699px) {
  body.is-authenticated { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .space-grid .space-card, .explore-grid .space-card {
    grid-template-columns: 40px minmax(0,1fr);
    gap: 12px;
    padding: 20px;
  }
  .space-card .space-icon { width: 40px; height: 40px; grid-row: 1; }
  .space-card .space-card-copy { grid-column: 2; grid-row: 1; }
  .space-card .section-status, .space-card .space-card-action { grid-column: 2; }
  .space-card .space-arrow { display: none; }
  .plan-notification { gap: 16px; }
  .dashboard-section-heading-split { flex-wrap: wrap; }
  .office-counts { gap: 8px; }
  .office-count { padding: 16px 12px; }
}
@media (max-width: 359px) {
  .nutrition-practical-reference .nutrition-reference-visual { grid-template-columns: minmax(0,1fr); }
  .nutrition-compass-standard-head { grid-template-columns: minmax(0,1fr); }
  .nutrition-compass-standard-head > span { max-width: 100%; }
  .office-counts { grid-template-columns: 1fr; }
  .office-count { flex-direction: row; align-items: center; gap: 12px; }
}
