/* Afterhrs Radar v2.12 — quality hardening and creator restoration pass. */
:root,
html[data-text-size="readable"] {
  --ahr-body-size: 19px;
  --ahr-control-size: 19px;
  --ahr-support-size: 17px;
  --ahr-table-size: 18px;
  --ahr-h1-size: clamp(35px, 3vw, 49px);
  --ahr-h2-size: clamp(29px, 2.4vw, 39px);
  --ahr-h3-size: clamp(24px, 1.8vw, 31px);
  --ahr-kpi-size: clamp(33px, 3vw, 47px);
  --ahr-line-height: 1.5;
  --ahr-control-height: 50px;
  --ahr-gap: 16px;
  --ahr-radius: 14px;
  --ahr-focus: #8fc7ff;
  --ahr-dark-bg: #07101b;
  --ahr-dark-surface: #101c2b;
  --ahr-dark-surface-2: #162538;
  --ahr-dark-line: #3d5877;
  --ahr-dark-text: #f7faff;
  --ahr-dark-muted: #c5d2e3;
  --ahr-light-bg: #eef3f8;
  --ahr-light-surface: #ffffff;
  --ahr-light-surface-2: #f5f8fb;
  --ahr-light-line: #91a4bb;
  --ahr-light-text: #142033;
  --ahr-light-muted: #44566c;
}

html[data-text-size="larger"] {
  --ahr-body-size: 22px;
  --ahr-control-size: 21px;
  --ahr-support-size: 19px;
  --ahr-table-size: 20px;
  --ahr-h1-size: clamp(41px, 3.7vw, 57px);
  --ahr-h2-size: clamp(34px, 3vw, 46px);
  --ahr-h3-size: clamp(28px, 2.3vw, 37px);
  --ahr-kpi-size: clamp(39px, 3.8vw, 55px);
  --ahr-control-height: 54px;
  --ahr-gap: 19px;
}

html[data-text-size="largest"] {
  --ahr-body-size: 25px;
  --ahr-control-size: 23px;
  --ahr-support-size: 21px;
  --ahr-table-size: 22px;
  --ahr-h1-size: clamp(47px, 4.5vw, 65px);
  --ahr-h2-size: clamp(39px, 3.7vw, 53px);
  --ahr-h3-size: clamp(32px, 2.8vw, 42px);
  --ahr-kpi-size: clamp(45px, 4.5vw, 63px);
  --ahr-control-height: 58px;
  --ahr-gap: 22px;
}

html {
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  max-width: 100%;
  overflow-x: clip;
  font-size: var(--ahr-body-size) !important;
  line-height: var(--ahr-line-height) !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[data-text-size] body {
  font-size: var(--ahr-body-size) !important;
  line-height: var(--ahr-line-height) !important;
}

body,
button,
input,
select,
textarea {
  font-family: Roboto, Inter, Arial, sans-serif !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:where(main, section, article, aside, header, footer, nav, form, fieldset, div, label, span, p, li, dl, dt, dd, table, thead, tbody, tr, th, td) {
  min-width: 0;
}

:where(p, li, dd, blockquote, figcaption, .copy, .description, .message, .note, .help, .empty, .error) {
  line-height: var(--ahr-line-height) !important;
  overflow-wrap: anywhere;
}

:where(h1, h2, h3, h4, h5, h6, p, li, label, legend, dt, dd, th, td, button, span, strong, small, code) {
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: pretty;
}

:where(a[href], .email, .url, .long-link, .creator-share-link, .creator-resource-url) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

body :where(a, span, strong, b, em, code, time) {
  font-size: max(1em, var(--ahr-support-size)) !important;
}

h1,
.public-card h1,
.welcome h1,
.workspace-header h1,
.owner-dashboard-v2 .od-title h2,
.os-head h2,
.apply-public-copy h1,
.application-shell h1 {
  font-size: var(--ahr-h1-size) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.025em !important;
}

h2,
.panel-head h2,
.apply-plan-copy h2,
.application-shell h2 {
  font-size: var(--ahr-h2-size) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.018em !important;
}

h3,
.od-panel-head h3,
.od-table-toolbar h3,
.os-panel h3 {
  font-size: var(--ahr-h3-size) !important;
  line-height: 1.22 !important;
}

:where(h4, h5, h6) {
  font-size: var(--ahr-control-size) !important;
  line-height: 1.3 !important;
}

:where(p, li, dd, figcaption, blockquote, .public-card > p, .welcome p, .panel p, .os-page, .creator-view, .application-page) {
  font-size: var(--ahr-body-size) !important;
}

:where(small, .eyebrow, .nav-section-label, .muted, .subtle, .helper, .hint, .caption, .meta, .status-badge, .os-eyebrow, .os-subtle, .header-date, .home-live-badge, .workspace-meta small, .stats span, .stats small, .dashboard-summary span, .dashboard-summary small, .performance-highlight-grid span, .sales-table small, .sales-table em) {
  font-size: var(--ahr-support-size) !important;
  line-height: 1.5 !important;
  letter-spacing: 0.02em !important;
}

body small,
body .eyebrow,
body .nav-section-label,
body .muted,
body .subtle,
body .helper,
body .hint,
body .caption,
body .meta,
body .status-badge,
body .os-eyebrow,
body .os-subtle,
body .header-date,
body .home-live-badge,
body .workspace-meta small,
body .stats span,
body .stats small,
body .dashboard-summary span,
body .dashboard-summary small,
body .performance-highlight-grid span,
body .sales-table small,
body .sales-table em {
  font-size: var(--ahr-support-size) !important;
  line-height: 1.5 !important;
}

body #header-account-name {
  font-size: var(--ahr-support-size) !important;
}

:where(label, legend, dt) {
  font-size: var(--ahr-support-size) !important;
  line-height: 1.45 !important;
}

:where(button, [role="button"], input, select, textarea, summary, .nav-item, .text-button, .os-link-button) {
  min-height: var(--ahr-control-height) !important;
  max-width: 100%;
  font-size: var(--ahr-control-size) !important;
  line-height: 1.35 !important;
}

:where(button, [role="button"], summary, .nav-item, .text-button, .os-link-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  padding: 0.55em 0.8em !important;
  white-space: normal !important;
  text-align: center;
}

:where(input, select, textarea) {
  width: 100%;
  padding: 0.55em 0.7em !important;
  border-width: 2px !important;
}

textarea {
  min-height: 7.5em !important;
  resize: vertical;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 4px solid var(--ahr-focus) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 7px rgba(65, 145, 230, 0.24) !important;
}

:where(.panel, .card, .public-card, .od-panel, .od-kpi, .os-card, .os-panel, .stats article, .shift-dashboard-stats article, .dashboard-summary button, .application-card, .creator-week-card, .creator-portal-card) {
  border-radius: var(--ahr-radius) !important;
}

:where(.stats, .shift-dashboard-stats, .dashboard-summary, .od-kpis, .os-kpis, .performance-highlight-grid, .home-workspace, .two, .sales-form, .social-platform-grid, .tenant-growth-tip-grid) {
  gap: var(--ahr-gap) !important;
}

:where(.stats strong, .shift-dashboard-stats strong, .dashboard-summary strong, .od-kpi strong, .os-kpi strong) {
  font-size: var(--ahr-kpi-size) !important;
  line-height: 1.08 !important;
}

:where(table) {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

:where(th, td, .od-table th, .od-table td, .os-table th, .os-table td) {
  height: auto !important;
  padding: 0.75em 0.65em !important;
  font-size: var(--ahr-table-size) !important;
  line-height: 1.45 !important;
  vertical-align: top;
  white-space: normal !important;
  overflow-wrap: normal;
  word-break: normal;
}

:where(th, .od-table th, .os-table th) {
  font-size: var(--ahr-support-size) !important;
}

/* Dense directories must distribute space by content and never split words. */
:where(.os-table, .od-table) {
  table-layout: auto !important;
}

:where(.os-table th, .os-table td, .od-table th, .od-table td, .os-badge, .od-status) {
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

:where(.os-badge, .od-status) {
  display: inline-flex !important;
  width: max-content;
  max-width: 100%;
  white-space: nowrap !important;
}

.os-person > div {
  min-width: 9rem;
}

/* Shared alignment rules: center interface copy inside every component. */
:where(h1, h2, h3, h4, h5, h6, p, figcaption, legend, dt, dd) {
  text-align: center !important;
}

:where(label, .field, .form-field, .input-group) {
  text-align: center !important;
}

:where(input, select, textarea) {
  text-align: center !important;
  vertical-align: middle;
}

:where(button, [role="button"], summary, .text-button, .os-link-button) {
  align-items: center;
  justify-content: center;
  text-align: center !important;
  vertical-align: middle;
}

:where(.od-owner-nav button, .sidebar .nav-item, .portal-menu button, .portal-menu a, .os-list button, .hq-attention-row > button) {
  justify-content: center !important;
  text-align: center !important;
}

:where(.panel, .card, .public-card, .od-panel, .od-kpi, .os-card, .os-panel, .stats article, .shift-dashboard-stats article, .dashboard-summary button) {
  text-align: center !important;
}

:where(.panel-head, .section-heading, .workspace-header, .welcome, .od-topbar, .od-table-toolbar, .os-head, .owner-header-actions, .header-actions) {
  text-align: center !important;
}

:where(.os-table th, .os-table td, .od-table th, .od-table td) {
  text-align: center !important;
  vertical-align: middle !important;
}

:where(.os-table th:first-child, .os-table td:first-child, .od-table th:first-child, .od-table td:first-child) {
  text-align: center !important;
}

:where(.os-person, .od-name) {
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

:where(.os-person > div, .od-name > div, .owner-command-copy, .sidebar .user-chip > span, .portal-menu .menu-copy) {
  text-align: center !important;
}

:where(.os-badge, .od-status, .status-badge, .chatter-status) {
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.2 !important;
}

:where(.eyebrow, .os-eyebrow, .nav-section-label, .step-label, .question-count, .owner-command-status, .portfolio-live, .social-sync-status, .schedule-save-status) {
  text-align: center !important;
}

:where(.auth-card, .creator-application-card, .apply-public-copy, .application-form-intro, .portal-content > header, .owner-command-head > div, .os-head > div, .od-title, .section-heading > div, .panel-head > div) {
  text-align: center !important;
}

/* Long-form writing stays naturally readable while its surrounding UI is centered. */
:where(#weekly-pad-text, .weekly-pad-reader, .support-thread-message, .request-thread-message, .message-body, .legal-copy p, .legal-copy li, article.long-form p, article.long-form li) {
  text-align: start !important;
}

:where(.shell, .portal-shell, .owner-dashboard-v2, .os-page, .creator-view, .apply-landing, .application-shell) {
  max-width: 100%;
}

.auth-screen {
  display: flex !important;
  min-height: 100dvh;
  overflow-y: auto !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--ahr-gap);
  padding: max(24px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)) !important;
}

body .auth-screen.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.auth-card,
.creator-application-card {
  width: min(100%, 760px) !important;
  margin: auto !important;
}

.auth-screen .public-legal-links {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  display: flex !important;
  width: min(100%, 760px) !important;
  margin: 0 auto !important;
  padding: 12px 0 !important;
  transform: none !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px !important;
  font-size: var(--ahr-support-size) !important;
}

:where(.panel-head, .section-heading, .workspace-header, .welcome, .od-topbar, .od-table-toolbar, .os-head, .owner-header-actions, .header-actions) {
  flex-wrap: wrap !important;
  gap: var(--ahr-gap) !important;
}

html[data-text-size] body.owner-mode.owner-dashboard-v2-ready .shell {
  grid-template-columns: 280px minmax(0, 1fr) !important;
}

html[data-text-size] body.owner-mode.owner-dashboard-v2-ready .sidebar {
  width: 280px !important;
}

html[data-text-size] body.owner-mode .os-page > .os-head {
  position: static !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

html[data-text-size] body.owner-mode .os-page > .os-head .os-actions {
  position: static !important;
  align-self: start !important;
  max-width: 100% !important;
}

html[data-text-size] body.owner-mode .os-tabs {
  flex-wrap: wrap !important;
  overflow: visible !important;
}

:where(.top-search, .od-search, .owner-creator-switcher, .hq-theme-picker) {
  width: min(100%, 34rem) !important;
  min-width: 0 !important;
}

:where(.top-search input, .od-search input, .owner-creator-switcher select, .hq-theme-picker select) {
  min-width: 0 !important;
}

:where(.sidebar, .portal-menu) :where(button, a, label, strong, small),
:where(.apply-site-header, .apply-site-footer) :where(a, p, span) {
  overflow-wrap: anywhere;
}

/* Saved text-size control. */
.ahr-text-size-control {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 2147483646;
  display: grid;
  justify-items: end;
  gap: 10px;
  max-width: min(92vw, 520px);
  font-family: Roboto, Arial, sans-serif !important;
}

.ahr-text-size-toggle {
  min-height: 46px !important;
  padding: 9px 14px !important;
  border: 2px solid #74a9dd !important;
  border-radius: 999px !important;
  background: #10243b !important;
  color: #f8fbff !important;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.42) !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}

.ahr-text-size-panel {
  width: min(92vw, 520px);
  max-height: min(75dvh, 720px);
  overflow: auto;
  padding: 24px;
  border: 2px solid #74a9dd;
  border-radius: 20px;
  background: #102033;
  color: #f7faff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

.ahr-text-size-panel[hidden] {
  display: none !important;
}

.ahr-text-size-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px !important;
  line-height: 1.25 !important;
}

.ahr-text-size-panel > p {
  margin: 0 0 18px;
  color: #c7d6e8 !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
}

.ahr-text-size-options {
  display: grid;
  gap: 12px;
}

.ahr-text-size-option {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 10px 12px;
  border: 2px solid #46698d;
  border-radius: 14px;
  background: #172c43;
  color: #f7faff !important;
  font-size: 18px !important;
  line-height: 1.35 !important;
  cursor: pointer;
}

.ahr-text-size-option:has(input:checked) {
  border-color: #8fc7ff;
  background: #21466b;
}

.ahr-text-size-option input {
  width: 28px !important;
  height: 28px !important;
  min-height: 0 !important;
  padding: 0 !important;
  accent-color: #8fc7ff;
}

.ahr-text-size-status {
  display: block;
  margin-top: 14px;
  color: #bfe4cc !important;
  font-size: 16px !important;
  line-height: 1.45 !important;
}

body::after {
  content: "v2.12" !important;
  left: max(12px, env(safe-area-inset-left)) !important;
  right: auto !important;
  bottom: max(12px, env(safe-area-inset-bottom)) !important;
  padding: 8px 11px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

/* Chatter HQ contains several legacy dense rows. Reflow them instead of
   squeezing enlarged copy into narrow columns. */
html[data-text-size] body:has(#dashboard) .workspace-header {
  align-items: stretch !important;
  flex-direction: column !important;
}

html[data-text-size] body:has(#dashboard) .workspace-header > div:first-child,
html[data-text-size] body:has(#dashboard) .workspace-meta {
  width: 100% !important;
  text-align: center !important;
}

html[data-text-size] body:has(#dashboard) .workspace-meta {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: var(--ahr-gap) !important;
}

html[data-text-size] body:has(#dashboard) .workspace-meta > *,
html[data-text-size] body:has(#dashboard) .workspace-clocks > *,
html[data-text-size] body:has(#dashboard) .workspace-indicators > * {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  border-left: 0 !important;
  text-align: center !important;
}

html[data-text-size] body:has(#dashboard) .workspace-clocks,
html[data-text-size] body:has(#dashboard) .workspace-indicators {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-column: span 2;
  gap: var(--ahr-gap) !important;
}

html[data-text-size] body:has(#dashboard) .dashboard-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html[data-text-size] body:has(#dashboard) .dashboard-summary button {
  display: flex !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

html[data-text-size] body:has(#dashboard) .dashboard-summary :is(span, strong, small) {
  width: 100% !important;
  text-align: center !important;
}

/* High-specificity floor: legacy authenticated styles contain ID and !important rules. */
html[data-text-size] body :is(#ahr-control-font-floor, button, [role="button"], input, select, textarea, summary, .nav-item, .text-button, .os-link-button) {
  min-height: var(--ahr-control-height) !important;
  font-size: var(--ahr-control-size) !important;
  line-height: 1.35 !important;
}

html[data-text-size] body :is(#ahr-support-font-floor, small, label, legend, dt, .eyebrow, .agency-hq-eyebrow, .nav-section-label, .muted, .subtle, .helper, .hint, .caption, .meta, .status-badge, .os-eyebrow, .os-subtle, .header-date, .home-live-badge, .hq-topbar p) {
  font-size: var(--ahr-support-size) !important;
  line-height: 1.5 !important;
}

html[data-text-size] body :is(#ahr-heading-one-floor, h1, .public-card h1, .welcome h1, .workspace-header h1, .owner-dashboard-v2 .od-title h2, .os-head h2, .apply-public-copy h1, .application-shell h1) {
  font-size: var(--ahr-h1-size) !important;
  line-height: 1.12 !important;
}

html[data-text-size] body :is(#ahr-heading-two-floor, h2, .panel-head h2, .apply-plan-copy h2, .application-shell h2) {
  font-size: var(--ahr-h2-size) !important;
  line-height: 1.18 !important;
}

html[data-text-size] body :is(#ahr-heading-three-floor, h3, .od-panel-head h3, .od-table-toolbar h3, .os-panel h3) {
  font-size: var(--ahr-h3-size) !important;
  line-height: 1.22 !important;
}

html[data-text-size] body :is(#ahr-table-font-floor, th, td, .od-table th, .od-table td, .os-table th, .os-table td) {
  font-size: var(--ahr-table-size) !important;
  line-height: 1.45 !important;
}

html[data-text-size] body :is(#ahr-table-heading-floor, th, .od-table th, .os-table th) {
  font-size: var(--ahr-support-size) !important;
}

html[data-text-size] body.creator-mode #selected-creator-name,
html[data-text-size] body.creator-mode #schedule-view .weekly-plan-heading .eyebrow,
html[data-text-size] body.creator-mode #schedule-view #week-date-range,
html[data-text-size] body.creator-mode #schedule-view #weekly-pad-access,
html[data-text-size] body.creator-mode #schedule-view .weekly-pad-empty > span {
  font-size: var(--ahr-support-size) !important;
  line-height: 1.5 !important;
}

html[data-text-size] body.creator-mode #schedule-view #schedule-subheading,
html[data-text-size] body.creator-mode #schedule-view .weekly-pad-empty > b {
  font-size: var(--ahr-body-size) !important;
  line-height: var(--ahr-line-height) !important;
}

html[data-text-size] body .ahr-text-size-control :is(#ahr-readability-ui-input, input) {
  width: 28px !important;
  height: 28px !important;
  min-height: 0 !important;
  padding: 0 !important;
}

html[data-text-size] body .ahr-text-size-control :is(#ahr-readability-ui-button, button) {
  min-height: 46px !important;
  font-size: 16px !important;
}

@media (max-width: 1500px) {
  body.owner-mode.owner-dashboard-v2-ready .shell {
    grid-template-columns: 280px minmax(0, 1fr) !important;
  }

  body.owner-mode.owner-dashboard-v2-ready .sidebar {
    width: 280px !important;
  }

  :where(.od-kpis, .os-kpis, .dashboard-summary, .stats, .shift-dashboard-stats, .performance-highlight-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  :where(.od-main-grid, .home-workspace, .os-grid) {
    grid-template-columns: 1fr !important;
  }

  html[data-text-size] body .home-workspace,
  html[data-text-size] body .od-main-grid,
  html[data-text-size] body .os-grid,
  html[data-text-size] body.owner-mode .hq-command-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-text-size] body.owner-mode .hq-card > header {
    flex-wrap: wrap !important;
  }

  html[data-text-size] body.owner-mode #schedule-view > .weekly-plan-heading {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  html[data-text-size] body.owner-mode #schedule-view .schedule-admin {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html[data-text-size] body.owner-mode #schedule-view .week-navigation {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html[data-text-size] body.owner-mode #schedule-view .week-navigation button {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
  }
}

@media (max-width: 1100px) {
  .portal-shell {
    grid-template-columns: 1fr !important;
  }

  .portal-menu {
    width: min(92vw, 520px) !important;
  }

  html[data-text-size] body.owner-mode .os-page > .os-head {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  :where(.two, .sales-form, .home-sale-row, .social-platform-grid, .tenant-growth-tip-grid) {
    grid-template-columns: 1fr !important;
  }

  :where(.od-table, .os-table, table) {
    table-layout: auto;
  }

  :where(.od-table, .os-table) {
    min-width: 0 !important;
  }
}

@media (max-width: 950px) {
  html[data-text-size] body.owner-mode.owner-dashboard-v2-ready .shell {
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-text-size] body.owner-mode.owner-dashboard-v2-ready .sidebar {
    width: min(92vw, 520px) !important;
  }
}

@media (max-width: 760px) {
  :root,
  html[data-text-size="readable"] {
    --ahr-body-size: 19px;
    --ahr-control-size: 19px;
    --ahr-support-size: 17px;
    --ahr-table-size: 18px;
    --ahr-h1-size: clamp(33px, 9vw, 43px);
    --ahr-h2-size: clamp(28px, 7.5vw, 37px);
    --ahr-h3-size: clamp(24px, 6vw, 31px);
    --ahr-kpi-size: clamp(32px, 8vw, 43px);
    --ahr-control-height: 52px;
    --ahr-gap: 14px;
  }

  html[data-text-size="larger"] {
    --ahr-body-size: 22px;
    --ahr-control-size: 21px;
    --ahr-support-size: 19px;
    --ahr-table-size: 20px;
    --ahr-h1-size: clamp(39px, 11vw, 51px);
    --ahr-h2-size: clamp(33px, 9vw, 43px);
    --ahr-h3-size: clamp(28px, 7vw, 36px);
    --ahr-kpi-size: clamp(38px, 10vw, 51px);
    --ahr-control-height: 56px;
  }

  html[data-text-size="largest"] {
    --ahr-body-size: 25px;
    --ahr-control-size: 23px;
    --ahr-support-size: 21px;
    --ahr-table-size: 22px;
    --ahr-h1-size: clamp(45px, 13vw, 59px);
    --ahr-h2-size: clamp(38px, 10.5vw, 49px);
    --ahr-h3-size: clamp(32px, 8vw, 41px);
    --ahr-kpi-size: clamp(44px, 12vw, 59px);
    --ahr-control-height: 60px;
  }

  body,
  main,
  .portal-content,
  .apply-landing,
  .application-shell {
    width: 100% !important;
    max-width: 100% !important;
  }

  .apply-site-header {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  main,
  .portal-content,
  .apply-landing,
  .application-shell,
  body.owner-mode.owner-dashboard-v2-ready main {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  :where(.od-kpis, .os-kpis, .dashboard-summary, .stats, .shift-dashboard-stats, .performance-highlight-grid, .two, .sales-form, .home-sale-row, .day-tabs, .apply-results-grid) {
    grid-template-columns: 1fr !important;
  }

  :where(.panel, .public-card, .od-panel, .od-kpi, .os-card, .os-panel, .stats article, .shift-dashboard-stats article, .dashboard-summary button) {
    padding: 20px !important;
  }

  :where(.shift-actions, .apply-public-actions, .os-actions, .owner-header-actions, .header-actions, .od-quick-actions, .creator-profile-actions) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  html[data-text-size] body.owner-mode .os-tabs {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-text-size] body.owner-mode .hq-focus-strip > nav {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-text-size] body.owner-mode .hq-focus-strip > nav button {
    width: 100% !important;
  }

  :where(.shift-actions button, .apply-public-actions a, .os-actions button, .owner-header-actions button, .header-actions button, .od-quick-actions button, .creator-profile-actions button) {
    width: 100% !important;
  }

  html[data-text-size] body.creator-mode .week-navigation {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-text-size] body.creator-mode .week-navigation button {
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: 0.8em !important;
  }

  html[data-text-size] body.owner-mode .hq-topbar > div:last-child {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
  }

  html[data-text-size] body.owner-mode .hq-topbar > div:last-child > * {
    width: 100% !important;
    grid-column: auto !important;
  }

  html[data-text-size] body:has(#dashboard) .workspace-meta,
  html[data-text-size] body:has(#dashboard) .workspace-clocks,
  html[data-text-size] body:has(#dashboard) .workspace-indicators,
  html[data-text-size] body:has(#dashboard) .dashboard-summary {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-text-size] body:has(#dashboard) .workspace-clocks,
  html[data-text-size] body:has(#dashboard) .workspace-indicators {
    grid-column: auto !important;
  }

  :where(.sales-table article, .list article) {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
  }

  :where(.ahr-text-size-control) {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .ahr-text-size-toggle {
    width: 48px !important;
    min-height: 48px !important;
    border-radius: 50% !important;
    padding: 10px 14px !important;
    font-size: 16px !important;
  }

  .ahr-text-size-toggle-label {
    display: none !important;
  }
}

@media (max-width: 430px) {
  :where(main, .portal-content, .apply-landing, .application-shell, body.owner-mode.owner-dashboard-v2-ready main) {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  :where(.panel, .public-card, .od-panel, .od-kpi, .os-card, .os-panel, .stats article, .shift-dashboard-stats article, .dashboard-summary button) {
    padding: 18px 16px !important;
  }

  .ahr-text-size-panel {
    padding: 19px;
  }
}

/* Final alignment contract. This deliberately outranks legacy page-specific
   !important declarations so every interactive surface follows one system. */
html[data-text-size] body :is(h1, h2, h3, h4, h5, h6, p, figcaption, legend, dt, dd, label, button, [role="button"], summary, input, select, textarea, th, td) {
  text-align: center !important;
}

html[data-text-size] body :is(.nav-item, .portal-menu button, .portal-menu a, .od-owner-nav button, .hq-attention-row > button, .hq-creator-pulse > button, .agency-hq-home .hq-creator-work button) {
  justify-content: center !important;
  text-align: center !important;
}

/* Natural reading alignment is retained only for extended prose and editing. */
html[data-text-size] body :is(#weekly-pad-text, .weekly-pad-reader, .weekly-pad-reader p, .weekly-pad-reader li, .support-thread-message, .support-thread-message p, .request-thread-message, .request-thread-message p, .message-body, .message-body p, .legal-copy p, .legal-copy li, article.long-form p, article.long-form li) {
  text-align: start !important;
}

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

@media (prefers-reduced-motion: no-preference) {
  :where(button, a, input, select, textarea, summary, .panel, .card) {
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease !important;
  }
}
