/* PC3 reading scale. Keep control geometry compact; never scale the whole page.
   Loaded last because the inherited PC2 styles include 8–11px text and several
   !important overrides. Important declarations below only replace those roles. */

/* Login is also readable when opened on a phone, without changing APP styles. */
.login-brand > div > span { font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.login-kicker, .login-card > .eyebrow { font-size: 12px; color: var(--ink-3); }
.login-copy p { font-size: 16px; line-height: 1.9; color: var(--ink-2); max-width: 540px; }
.login-points { font-size: 14px; gap: 24px; flex-wrap: wrap; }
.login-points .ico { width: 18px; height: 18px; }
.login-card { width: min(460px, 100%); }
.login-card > p.muted { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.login-card .field > label { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.login-card .input { font-size: 16px; height: 46px; }
.login-card .login-submit { font-size: 15px; height: 46px !important; }
.login-error { font-size: 14px; line-height: 1.65; }
.demo-login > span { font-size: 13px; color: var(--ink-3); }
.demo-accounts button { font-size: 14px; min-height: 38px; }
.login-foot { font-size: 13px; line-height: 1.7; color: var(--ink-3); }

/* Desktop only: mobile web retains its existing compact content scale. */
@media (min-width: 1081px) {
  :root {
    --pc3-text-body: 15px;
    --pc3-text-control: 14px;
    --pc3-text-meta: 13px;
    --pc3-text-heading: 16px;
  }
  body { font-size: var(--pc3-text-body); }

  /* Shell and search. Decorative badges and keyboard hints can stay smaller. */
  .nav-item { font-size: 15px; }
  .nav-label { font-size: 12px; }
  .nav-badge { font-size: 12px; }
  .brand-info small, .user-meta small, .today-card p, .tc-link, .tc-frac { font-size: var(--pc3-text-meta); }
  .today-card strong { font-size: var(--pc3-text-control); }
  .tc-head { flex-wrap: wrap; }
  .tc-head strong, .tc-frac { white-space: nowrap; }
  .user-chip .name, .search-trigger { font-size: var(--pc3-text-control); }
  .view .page-head p, .panel-head p, .view .panel-head p { font-size: var(--pc3-text-meta); line-height: 1.6; }
  .panel-head h3, .view .panel-head h3 { font-size: var(--pc3-text-heading); }

  /* Forms, menus and actions have a common reading size, including portals. */
  .btn, .input, .select, .view .btn, .view .input, .view .select,
  .modal .btn.sm, .drawer .btn.sm,
  .view .btn.sm, .view .content-toolbar .btn, .view .pc3-route-actions .btn,
  .view textarea.input, .modal textarea.input, .drawer textarea.input,
  .pc3-select-menu, .pc3-select-option, .mg-period-presets button,
  .mg-team-page .team-head-actions .btn, .mg-segments button,
  .mg-setting-nav > .btn, .view .store-tab, .customer-sales-topline .store-tab,
  .customer-content-topline .store-tab, .pc3-visits-topline #visit-tabs > button {
    font-size: var(--pc3-text-control);
  }
  .view .brand-forms .settings-inline .btn { font-size: var(--pc3-text-control) !important; }
  .view .brand-forms .settings-inline .input,
  .view .settings-block .settings-inline > .input:not(.file-input) { font-size: var(--pc3-text-control); }
  .view .filter-select, .view .visit-filter-tools > .filter-select { font-size: var(--pc3-text-control) !important; }
  .field > label, .field > span, .modal .field > span, .drawer .field > span,
  .pc3-route-scope label, .pc3-inline-field, .customer-secondary-field > span { font-size: var(--pc3-text-control); }
  .view .field > span, .view .settings-section .field > span { font-size: var(--pc3-text-control) !important; }
  .pc3-select-group, .pc3-select-empty, .palette-item small, .palette-foot { font-size: var(--pc3-text-meta); }

  /* Customer names and business values are primary content, not footnotes. */
  .view .table td, .drawer .table td { font-size: var(--pc3-text-control); }
  .view .table th, .drawer .table th { font-size: var(--pc3-text-meta); }
  .view .analytics-members .table thead th { font-size: var(--pc3-text-meta); }
  .view .table .cell-main strong, .view .member-name strong,
  .view .team-mini-list .tm-line strong, .view .rank-name strong,
  .view .customer-match-card > strong {
    font-size: var(--pc3-text-body); line-height: 1.6;
  }
  .view .table-person, .view .type-label { font-size: var(--pc3-text-control); }
  .view .table .cell-main > div { min-width: 0; }
  .view .table .cell-main strong { overflow-wrap: anywhere; }
  .view .table td small { color: var(--ink-3); }

  /* Override inherited important micro-text by role. No universal minimum rule:
     large numbers, icon glyphs, avatars and hidden accessibility text are separate. */
  .view :is(small, .mini-stat small, .stat-strip small, .table td small, .cell-main small,
    .owner-title small, .owner-route-stats small, .owner-customer-main > small,
    .region-stat small, .audit-sum-card small) { font-size: var(--pc3-text-meta) !important; }
  .view :is(.pill, .tag, .type-chip, .mini-chip, .tm-role, .record-meta, .audit-action,
    .audit-detail, .member-today, .mp-label, .mp-label b, .stop-meta, .form-hint,
    .settings-section .form-hint, .settings-block-tag, .settings-block-head p,
    .brand-forms .settings-block-head p, .settings-section .settings-note p,
    .brand-preview-label, .map-foot, .map-tip, .mini-stat em, .goal-foot,
    .audit-sum-card p, .rule-card p, .audit-sum-card strong em, .member-stats strong em,
    .team-stat strong em, .team-stat em, .member-admin-metrics strong em,
    .member-foot .rating, .owner-customer-seq, .stop-seq, .hero-team, .sla-copy,
    .act-body, .act-body time, .table-foot, .panel-tag, .team-filter-chip b,
    .sla-ring-inner span, .table-toolbar span, .list-head span, .pager-current,
    .cnt, .col-count, .rank-medal, .visit-date-filter > span, .visit-date-filter > em,
    .owner-customer-main > p) { font-size: var(--pc3-text-meta) !important; }
  .view .settings-block-head h3 { font-size: var(--pc3-text-heading) !important; }
  .view .ai-tag { font-size: 12px !important; }

  /* Workbench summary and member progress. */
  .hero-eyebrow, .hero-delta, .hero-sub, .hero-unit, .goal-top > span,
  .hero-legend, .ai-reco > span, .hero-ai-foot, .sla-copy > span,
  .view .panel-link, .view .panel-more, .tm-line b { font-size: var(--pc3-text-meta); }
  .ai-panel-label, .hero-ai p, .sla-copy strong { font-size: var(--pc3-text-control); }
  .hero-ai p { line-height: 1.8; }
  .hero-ai-foot, .sla-copy > span { line-height: 1.6; }
  .hero-ai-foot { color: var(--ink-3); }
  .hero-number-row { flex-wrap: wrap; }

  /* Visit lists, route cards, empty states and route-picker dialogs. */
  .view :is(.task-addr, .task-foot, .visit-row p, .record-main p, .stop-card p,
    .route-note, .map-head p, .vr-meta, .vr-date, .pc3-visits-filter .hint, .pc3-record-count,
    .pc3-overview-store p, .pc3-operation-history > summary > span,
    .pc3-operation-history p, .pc3-pager, .pc3-plan-summary > span,
    .pc3-failure-list, .pc3-route-drop-slot, .pc3-route-drop-slot > span,
    .customer-scope-note, .customer-sales-note, .customer-source-card > p,
    .customer-pending-check, .customer-import-flags, .analytics-note,
    .rank-score, .rank-foot, .team-mini-foot, .api-loading > span) { font-size: var(--pc3-text-meta); line-height: 1.7; }
  .view .empty strong { font-size: var(--pc3-text-body); }
  .view .empty > span:not(.empty-orb) { font-size: var(--pc3-text-meta); line-height: 1.7; }
  .pc3-route-days > button { flex-basis: 53px; min-height: 72px; }
  .view .pc3-route-days :is(small, span) { font-size: var(--pc3-text-meta); }
  .pc3-store-choice strong { font-size: var(--pc3-text-control); }
  .pc3-store-choice small, .route-customer-search .hint { font-size: var(--pc3-text-meta); }
  .modal :is(.route-customer-main > small, .owner-customer-main > small, .owner-customer-main > p,
    .form-hint, .hint, .table td small, .cell-main small, .customer-code,
    .customer-scope-note, .pc3-pager, .record-meta) {
    font-size: var(--pc3-text-meta); line-height: 1.7; color: var(--ink-3);
  }
  .modal :is(.route-customer-main > strong, .owner-customer-main > strong, .cell-main strong) { font-size: var(--pc3-text-body); }
  .modal .table th { font-size: var(--pc3-text-meta); }
  .modal .table td { font-size: var(--pc3-text-control); }

  /* KPI labels, chart legends and categories must be readable independently of
     the oversized KPI numbers. SVG axes retain their own viewBox-aware sizing. */
  .mg-dashboard .kpi-label { font-size: var(--pc3-text-control); }
  .mg-dashboard .kpi-hint, .mg-dashboard .panel-head p,
  .mg-dashboard .mg-chart-legend, .mg-dashboard .city-rank,
  .mg-dashboard .city-top span, .mg-dashboard .city-top b,
  .mg-dashboard .donut-hole span, .mg-dashboard .coverage-hero > div:last-child p,
  .mg-dashboard .coverage-hero > div:last-child > span, .mg-dashboard .coverage-legend,
  .mg-notes, .mg-table-details summary, .mg-notes summary,
  .mg-sales-brand-metrics .table-toolbar p { font-size: var(--pc3-text-meta); line-height: 1.65; }
  .mg-dashboard .city-top strong { font-size: var(--pc3-text-body); }
  .mg-dashboard .kpi-label { color: var(--ink-2); }
  .mg-dashboard .kpi-hint { color: var(--ink-3); }
  .mg-dashboard .donut-legend span, .mg-dashboard .mg-legend-button { font-size: var(--pc3-text-control); }
  .mg-team-page .team-stat p, .member-progress .mp-label,
  .member-name small, .member-foot, .team-admin-note,
  .mg-team-warning { font-size: var(--pc3-text-meta); }
  .mg-team-page .team-filter-chip > button:first-child { font-size: var(--pc3-text-control); }

  /* Settings, upload controls, modal details and customer-group region pickers. */
  .view .settings-tab { font-size: var(--pc3-text-control); }
  .view .settings-note strong { font-size: var(--pc3-text-control); }
  .view .settings-section :is(.settings-panel-head p, .settings-block-head p,
    .settings-note p, .brand-preview > span, .brand-preview-foot) { color: var(--ink-3); }
  .view .settings-panel-head p, .view .settings-section .settings-panel-head p,
  .view .brand-preview > span,
  .view .brand-preview-foot, .pc3-account-summary p,
  .customer-picker-foot, .customer-group-preview-actions,
  .customer-region-picker > summary span, .customer-region-columns h3,
  .customer-region-option, .customer-region-choice, .pc3-account-options small,
  .modal .form-hint, .modal .hint, .drawer :is(.form-hint, .hint),
  .modal-head p, .drawer-head p, .drawer .ds-head > span,
  .drawer .table td small, .drawer .customer-code, .drawer .note-box small,
  .drawer .dm-item > small, .drawer .record-meta,
  .drawer .record-side > span, .drawer .customer-history-row time,
  .drawer .evidence small, .drawer .vs-time, .pc3-file-input,
  .mg-sales-source-checks small { font-size: var(--pc3-text-meta); line-height: 1.7; }
  .customer-region-picker > summary, .customer-edit-section > summary,
  .customer-sales-summary > summary, .customer-sales-line,
  .drawer .info-list dt, .drawer .member-info-list span { font-size: var(--pc3-text-control); }
  .drawer .info-list dd { font-size: var(--pc3-text-body); }
  .drawer-head .eyebrow,
  .drawer .drawer-body :is(small, .pill, .tag, .customer-code, .record-meta,
    .store-kpis strong em, .member-profile-stats small) { font-size: var(--pc3-text-meta); }
  input[type="file"]::file-selector-button { font-size: var(--pc3-text-control); }
}

@media (max-width: 680px) {
  .login-card { max-width: 420px; }
  .login-card .field { margin-top: 16px; }
  .login-foot { font-size: 12px; }
}
