/* Shared readability and interaction polish. Kept dependency-free and loaded last. */
html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
}

body,
button,
input,
select,
textarea {
  font-kerning: normal;
}

p,
li,
dd,
label,
summary {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  line-height: 1.02 !important;
  text-wrap: balance;
}

.brand,
.admin-brand,
.coach-mark {
  line-height: .96 !important;
}

button,
a,
input,
select,
textarea,
summary {
  border-radius: 2px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--accent, #ed854b);
  outline-offset: 3px;
}

input,
select,
textarea {
  min-height: 44px;
}

textarea {
  line-height: 1.55;
}

/* Public site: raise microcopy to a readable minimum. */
.preview-bar,
.photo-caption,
.photo-label,
.sample-note,
.price-label,
.order-row .order-meta,
.film-index,
.activation-kicker,
.activation-help,
.step-link,
.account-identity span,
.brand span,
footer small {
  font-size: 11px;
  line-height: 1.45;
}

.hero-bottom,
.plan-top .badge,
.training-shot figcaption,
.hero-benefits span,
.security-points span,
.cookie-banner p,
.cookie-banner button,
.guest-actions a,
.account-dropdown > a,
.account-dropdown > button,
.preview-actions a:first-child,
.claim-prompt .button {
  font-size: 11px;
}

.header .brand span,
.brand span {
  letter-spacing: 1.6px;
}

.guest-actions a,
.account-dropdown > a,
.account-dropdown > button,
.cookie-banner button {
  min-height: 44px;
}

/* Keep the hero caption clear of the primary CTA on shorter desktop screens. */
@media (min-width: 721px) {
  .hero-bottom > span:first-child {
    position: absolute;
    bottom: 64px;
    left: 0;
    white-space: nowrap;
  }
}

/* Member portal. */
.portal-header .header-actions a,
.portal-header .header-actions button,
.portal-header .brand span,
.portal-header ~ main .eyebrow,
.section-number,
.card-label,
.trust-list span,
.auth-tabs button,
.auth-form label,
.auth-form small,
.primary-button,
.coach-link,
.membership-head span,
.countdown span,
.online-dot,
.message time,
.chat-locked a,
.history-row span,
.history-row b,
.wellness-tabs button,
.wellness-form label,
.wellness-form button,
.wellness-status,
.member-progress-cards span,
.member-progress-cards p,
.member-chart span,
.wellness-history strong,
.wellness-history b,
.wellness-history span,
.checkin-history strong,
.checkin-history span,
.checkin-history > article > p,
.checkin-history blockquote b,
.checkin-history blockquote p,
.feature-empty,
.member-photo-gallery figcaption {
  font-size: 11px;
  line-height: 1.55;
}

.portal-header .header-actions a,
.portal-header .header-actions button,
.auth-tabs button,
.coach-link,
.wellness-tabs button {
  min-height: 44px;
}

/* Coach panel: dense data remains compact, but no longer microscopic. */
.admin-sidebar nav button,
.sidebar-bottom span,
.sidebar-bottom button,
.admin-topbar,
.page-heading p,
.metric span,
.table-toolbar > div > span,
.filters input,
.filters select,
.member-table th,
.mini-avatar,
.member-cell strong,
.contact-cell strong,
.member-cell span,
.contact-cell span,
.status-pill,
.empty-detail p,
.detail-head small,
.detail-status,
.contact-list dt,
.contact-list dd,
.section-title span,
.mini-membership strong,
.mini-membership span,
.grant-form label,
.quick-days button,
.action-button,
.add-admin-panel form > button,
.panel-status,
.message p,
.message time,
.admin-row span,
.admin-role,
.admin-row button,
.add-admin-panel > p,
.add-admin-panel label,
.photo-button b,
.notification-toggle,
.chat-expand-button,
.action-row strong,
.action-row small,
.action-row b,
.order-main span,
.order-facts span,
.order-facts b,
.order-actions button,
.note-row button,
.history-feature-row button,
.export-grid a,
.audit-row strong,
.audit-row span,
.audit-row time,
.member-tabs button,
.feature-form input,
.feature-form select,
.feature-form textarea,
.checkin-row textarea,
.feature-form button,
.checkin-row form button,
.note-row p,
.note-row small,
.progress-current span,
.progress-current small,
.history-feature-row,
.photo-gallery span,
.photo-gallery button,
.checkin-row strong,
.checkin-row span,
.checkin-row p,
.photo-compare > strong,
.photo-compare select {
  font-size: 11px;
  line-height: 1.5;
}

.notification-toggle {
  font-size: 11px !important;
}

.admin-sidebar nav button,
.sidebar-bottom button,
.quick-days button,
.action-button,
.admin-row button,
.notification-toggle,
.chat-expand-button,
.member-tabs button,
.order-actions button,
.note-row button,
.history-feature-row button,
.feature-form button,
.checkin-row form button {
  min-height: 40px;
}

.admin-sidebar nav button,
.page-heading p,
.metric span,
.member-table th,
.status-pill,
.section-title span,
.admin-role,
.member-tabs button {
  letter-spacing: .75px;
}

/* Shopier claim and demo screens. */
.back-link,
.steps span,
.secure-label,
form > label,
.result-top small,
.code-box > span,
.code-box > button,
.expiry,
.trust-row span,
.help,
.help::before,
.story-intro,
.layout label small,
.fake-payment span,
.fake-payment em,
.plan-row span,
.secure-note,
.order-number,
.order-number strong,
.code-box button,
.tip,
.shopier-footer {
  font-size: 11px !important;
  line-height: 1.5;
}

.back-link,
.code-box > button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Improve subdued text contrast on dark application surfaces. */
.portal-header ~ main,
.admin-main,
.admin-sidebar {
  --muted: #aeb4a8;
}

@media (max-width: 760px) {
  h1,
  h2,
  h3 {
    overflow-wrap: break-word;
  }

  .hero h1,
  .auth-story h1,
  .dashboard h1,
  .page-heading h1 {
    line-height: 1 !important;
  }

  .header > .button {
    min-height: 44px;
  }

  .member-tabs,
  .wellness-tabs {
    gap: 8px;
  }

  .member-table-wrap {
    scrollbar-color: var(--accent, #ed854b) transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Full-size member and coach workspaces. */
.portal-page,
.coach-page {
  font-size: 15px;
}

.portal-page :where(p, label, time, dt, dd, figcaption),
.coach-page :where(p, label, time, th, td, dt, dd) {
  font-size: 13px !important;
  line-height: 1.65;
}

.portal-page :where(input, select, textarea),
.coach-page :where(input, select, textarea) {
  min-height: 48px;
  font-size: 14px !important;
  line-height: 1.5;
}

.portal-page :where(
  .header-actions a,
  .header-actions button,
  .eyebrow,
  .section-number,
  .card-label,
  .trust-list span,
  .auth-tabs button,
  .auth-form small,
  .primary-button,
  .coach-link,
  .membership-head span,
  .countdown span,
  .online-dot,
  .chat-locked a,
  .history-row strong,
  .history-row span,
  .history-row b,
  .wellness-tabs button,
  .wellness-form button,
  .wellness-status,
  .member-progress-cards span,
  .member-progress-cards p,
  .member-chart span,
  .wellness-history strong,
  .wellness-history b,
  .wellness-history span,
  .checkin-history strong,
  .checkin-history span,
  .checkin-history blockquote b,
  .feature-empty,
  .member-photo-gallery figcaption,
  .auth-explainer,
  .notification-toggle,
  .notification-toast,
  .redeem-card > div > p:last-child,
  .redeem-field button,
  #redeem-status,
  .redeem-card > a,
  .photo-button b
) {
  font-size: 13px !important;
  line-height: 1.5;
}

.portal-page :where(
  .header-actions a,
  .header-actions button,
  .auth-tabs button,
  .primary-button,
  .coach-link,
  .wellness-tabs button,
  .wellness-form button,
  .notification-toggle,
  .redeem-field button,
  .redeem-card > a
) {
  min-height: 46px;
  padding-inline: 14px;
}

.portal-page .auth-story > p:not(.eyebrow),
.portal-page .membership-card > p:not(.card-label),
.portal-page .message p,
.portal-page .chat-locked p,
.portal-page .checkin-history > article > p,
.portal-page .checkin-history blockquote p {
  font-size: 14px !important;
  line-height: 1.75;
}

.portal-page .message {
  padding: 15px 17px;
}

.coach-page :where(
  .admin-brand span,
  .admin-sidebar nav button,
  .sidebar-bottom span,
  .sidebar-bottom button,
  .admin-topbar,
  .page-heading p,
  .page-heading > span,
  .metric span,
  .table-toolbar > div > span,
  .member-table th,
  .mini-avatar,
  .member-cell strong,
  .contact-cell strong,
  .member-cell span,
  .contact-cell span,
  .status-pill,
  .empty-detail p,
  .detail-head small,
  .detail-status,
  .section-title span,
  .mini-membership strong,
  .mini-membership span,
  .quick-days button,
  .action-button,
  .add-admin-panel form > button,
  .panel-status,
  .admin-row strong,
  .admin-row span,
  .admin-role,
  .admin-row button,
  .add-admin-panel > p,
  .photo-button b,
  .notification-toggle,
  .notification-toast,
  .chat-expand-button,
  .action-row strong,
  .action-row small,
  .action-row b,
  .feature-empty,
  .order-main strong,
  .order-main span,
  .order-facts span,
  .order-facts b,
  .order-actions button,
  .note-row button,
  .history-feature-row button,
  .export-grid a,
  .audit-row strong,
  .audit-row span,
  .member-tabs button,
  .feature-form button,
  .checkin-row form button,
  .note-row small,
  .progress-current span,
  .progress-current small,
  .history-feature-row,
  .photo-gallery span,
  .photo-gallery button,
  .checkin-row strong,
  .checkin-row span,
  .photo-compare > strong,
  .photo-compare select
) {
  font-size: 13px !important;
  line-height: 1.5;
}

.coach-page :where(
  .admin-sidebar nav button,
  .sidebar-bottom button,
  .quick-days button,
  .action-button,
  .add-admin-panel form > button,
  .admin-row button,
  .notification-toggle,
  .chat-expand-button,
  .order-actions button,
  .note-row button,
  .history-feature-row button,
  .member-tabs button,
  .feature-form button,
  .checkin-row form button
) {
  min-height: 44px;
  padding-inline: 12px;
}

.coach-page .message p,
.coach-page .note-row p,
.coach-page .checkin-row p,
.coach-page .page-heading > span {
  font-size: 14px !important;
  line-height: 1.7;
}

.coach-page .member-table td,
.coach-page .action-row,
.coach-page .order-row,
.coach-page .audit-row {
  padding-block: 17px;
}

@media (max-width: 760px) {
  .portal-page,
  .coach-page {
    font-size: 14px;
  }

  .portal-page .wellness-tabs,
  .coach-page .member-tabs {
    overflow-x: auto;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .coach-page .admin-topbar {
    min-height: 76px;
    height: auto;
    gap: 10px;
  }
}
