/* Dynamic player identities must fit even when a registered name has no spaces. */
#nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit-head > div { min-width: 0; max-width: 100%; }
#nexus-cabinet-demo #nx-cabinet-shell :is(.nx-cockpit-head h1, .nx-overview-head h1, #nx-player-name, .nx-passport-copy > span, .nx-passport-copy > strong, .nx-passport-copy > small) { overflow-wrap: anywhere; }
#nexus-cabinet-demo #nx-cabinet-shell .nx-passport-copy > small { white-space: normal; }

/* Desktop cabinet scale. Auth and the existing mobile/tablet layouts keep their own sizing. */
@media (min-width: 1280px) {
  #nexus-cabinet-demo #nx-cabinet-shell { font-size: 16px; line-height: 1.55; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-app { grid-template-columns: clamp(260px, 10.5vw, 280px) minmax(0, 1fr); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-sidebar { padding: 34px 22px; gap: 34px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-nav { gap: 8px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-nav button { min-height: 50px; padding: 12px 15px; gap: 13px; font-size: 16px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-eyebrow, .nx-nav-group, .nx-side-foot, .nx-demo-bar, .nx-demo-referral span) { font-size: 13px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-demo-bar { min-height: 46px; padding-inline: 28px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-main { width: 100%; max-width: none; padding: 40px clamp(28px, 2.2vw, 54px) 64px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-overview, .nx-overview.nx-cockpit, .nx-rm-page, .nx-ref-page, .nx-ach-page, .nx-ts-page, .nx-lib-page, .nexus-playing-page) { width: 100%; max-width: none; min-width: 0; }
  #nexus-cabinet-demo #nx-cabinet-shell h1 { font-size: clamp(40px, 3vw, 52px); }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-heading, .nx-rm-head, .nx-ach-page-head, .nx-lib-page-head, .nx-ts-head, .npl-page-head) p { font-size: 16px; max-width: 68ch; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-button, .nx-link, .nx-select, .nx-input, .nx-finance-requests, .nx-account-popover button) { font-size: 16px; min-height: 46px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-badge, .nx-meta, .nx-compact, .nx-material-type, .nx-notice) { font-size: 13px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-section-head h2, .nx-support h2, .nx-passport h2, .nx-league-path h2, .nx-playing-plan-card h2, .nx-lib-panel h2, .nx-ts-results-head h2, .npl-block-head h2, .npl-access-head h2) { font-size: 24px; }

  /* Keep the overview's primary workspace and context rail in proportion. */
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit-layout { grid-template-columns: minmax(0, 1fr) minmax(332px, min(34%, 680px)); gap: 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-cockpit-primary, .nx-cockpit-rail) { gap: 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit-head { margin-bottom: 30px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit-head > div > span { font-size: 27px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-module-label { font-size: 24px; padding: 22px 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-module-label em { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-position-grid { grid-template-columns: minmax(210px, 1.12fr) repeat(2, minmax(135px, .72fr)); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-position-grid > dl { min-height: 178px; padding: 30px 22px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-position-grid dt { font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-position-primary dd { font-size: clamp(72px, 5.2vw, 96px); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-position-stat dd { font-size: clamp(44px, 3.2vw, 58px); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-position-grid small { font-size: 13px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-position-action { flex-wrap: wrap; gap: 12px 20px; padding: 18px 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-cockpit .nx-position-action p { font-size: 15px; max-width: 40ch; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-year-metrics { grid-template-columns: minmax(180px, 1.45fr) repeat(3, minmax(90px, .72fr)); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-year-metrics dl { padding: 26px 18px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-year-metrics dt { font-size: 12px; letter-spacing: .04em; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-year-metrics dd { font-size: clamp(27px, 2.1vw, 36px); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-year-metrics .nx-year-result dd { font-size: clamp(44px, 3.2vw, 64px); }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-year-chart-head > div > span, .nx-year-chart-head small, .nx-year-months, .nx-year-footer) { font-size: 13px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-year-chart-head strong { font-size: 20px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-year-footer { flex-wrap: wrap; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-year-footer .nx-run-open { font-size: 15px; min-height: 46px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-passport, .nx-league-path, .nx-playing-plan-card) { padding: 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-passport-body { grid-template-columns: 78px minmax(0, 1fr) 82px; gap: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-passport-copy > span { font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-passport-copy > small, .nx-passport-level > small) { font-size: 13px; white-space: normal; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-passport-level > span, .nx-rail-card-head > span, .nx-plan-metrics dt, .nx-plan-next > span) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-tier-label strong { font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-tier-label span, .nx-league-tier li, .nx-plan-next > small) { font-size: 14px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-league-tier li { min-height: 36px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-league-tier li em, .nx-tier-lock) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-plan-metrics dd { font-size: 19px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-plan-next > strong { font-size: 20px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-plan-next > button { font-size: 15px; min-height: 46px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-latest-achievement { min-height: 120px; padding: 22px 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-latest-achievement small { font-size: 13px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-latest-achievement strong { font-size: 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-latest-achievement em { font-size: 14px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-month-plan-banner-copy > span, .nx-month-plan-banner-action small) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-month-plan-banner-copy > p { font-size: 15px; max-width: 70ch; }

  /* Playing uses its external stylesheet; raise its explicit small text as well. */
  #nexus-cabinet-demo #nx-cabinet-shell :is(.npl-label, .npl-state, .npl-identity span, .npl-marker-label, .npl-agreement-status, .npl-sample-labels, .npl-history-groups h3) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.npl-identity small, .npl-license-field p, .npl-block-head p, .npl-fast-head p, .npl-access-head p, .npl-fact span, .npl-review-number span, .npl-review-foot span, .npl-fast-breakdown, .npl-format span span, .npl-history-groups p, .npl-history-groups li > span) { font-size: 14px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.npl-fact strong, .npl-review-foot strong, .npl-format strong, .npl-rule-cell strong, .npl-agreement-item strong, .npl-history-groups strong, .npl-history-groups a) { font-size: 17px; }
  #nexus-cabinet-demo #nx-cabinet-shell .npl-fast-head h3 { font-size: 20px; }
  #nexus-cabinet-demo #nx-cabinet-shell .npl-block-head { flex-wrap: wrap; gap: 10px 18px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.npl-coach-note span, .npl-coach-note p, .npl-history > summary) { font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell .npl-coach-note { grid-template-columns: 160px minmax(0, 1fr); }
  #nexus-cabinet-demo #nx-cabinet-shell .npl-review-number strong { font-size: clamp(34px, 2.5vw, 48px); }

  /* Tables retain their numeric hierarchy and get room for readable row labels. */
  #nexus-cabinet-demo #nx-cabinet-shell .nx-table { font-size: 16px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-table th { font-size: 13px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-table td { padding-block: 18px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-rm-range b, .nx-rm-total-card small, .nx-rm-showcase-metrics dt, .nx-rm-selected-result small, .nx-rm-ledger summary span, .nx-rm-card-status, .nx-rm-card-note) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-rm-range span, .nx-rm-showcase-title p, .nx-rm-ledger > p) { font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-rm-total-card strong { font-size: 36px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-rm-card-deck { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-rm-card { min-height: 248px; padding: 20px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-rm-card > strong { font-size: clamp(32px, 2.2vw, 44px); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-rm-showcase-metrics dd { font-size: 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-rm-ledger summary { font-size: 18px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ts-workspace { grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 380px); gap: 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ts-row { grid-template-columns: 64px minmax(155px, 1.7fr) 75px 94px 63px 78px 84px; gap: 10px; padding: 18px 16px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ts-row > time, .nx-ts-event strong, .nx-ts-cell strong, .nx-ts-context strong, .nx-ts-preset strong) { font-size: 16px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ts-event > span, .nx-ts-cell small, .nx-ts-context span, .nx-ts-summary-grid dt, .nx-ts-mix-legend) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ts-field, .nx-ts-builder-head p, .nx-ts-context small, .nx-ts-demo, .nx-ts-results-head p, .nx-ts-summary-head small, .nx-ts-preset small, .nx-ts-size-card p, .nx-ts-build-row p, .nx-ts-balance) { font-size: 14px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ts-mode button, .nx-ts-room, .nx-ts-replace, .nx-ts-build, .nx-ts-preview-room, .nx-ts-results-head button, .nx-ts-more summary) { min-height: 46px; font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ts-size-number button { width: 46px; height: 46px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ts-summary-grid dd { font-size: 20px; }

  /* Referral labels fit the actual chart width instead of the old 490px minimum. */
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-engine-grid { grid-template-columns: minmax(330px, .95fr) 132px minmax(390px, 1.25fr); }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ref-network-stage, .nx-ref-outcome-stage) { padding: 30px 24px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-chart-labels { width: 100%; min-width: 0; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-chart svg { max-height: none; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ref-stage-note, .nx-ref-stage-head h2, .nx-ref-lane-copy strong, .nx-ref-lane-value, .nx-ref-share-label, .nx-ref-action-copy small) { font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ref-stage-kicker, .nx-ref-accepted-count, .nx-ref-lane-copy small, .nx-ref-lane-value i, .nx-ref-network-foot span, .nx-ref-network-foot small, .nx-ref-growth-chip span, .nx-ref-formula small, .nx-ref-month span, .nx-ref-month b, .nx-ref-demo-note) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-lane { min-height: 80px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-formula strong { font-size: 19px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-month { min-height: 52px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-chart-readout { font-size: 14px; flex-wrap: wrap; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-chart-readout strong { font-size: 14px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ref-gate-core > span, .nx-ref-gate-core small) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-gate-core strong { font-size: 13px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-details summary { font-size: 16px; min-height: 52px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ref-terms p { font-size: 15px; max-width: 72ch; }

  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ach-hero-kicker, .nx-ach-next-label, .nx-ach-event small, .nx-ach-row time, .nx-ach-next-foot) { font-size: 12px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ach-next p, .nx-ach-row p, .nx-ach-section-head p) { font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-ach-event span, .nx-ach-row strong) { font-size: 17px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ach-next-foot { flex-wrap: wrap; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ach-row { min-height: 92px; padding-block: 18px; }

  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-lib-kicker, .nx-lib-thumb-label, .nx-lib-duration, .nx-lib-complete, .nx-lib-player-time, .nx-lib-note-form small, .nx-lib-goal-form small) { font-size: 13px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-meta { font-size: 15px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-progress { font-size: 14px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-card-copy { padding: 20px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-card-copy strong { font-size: 20px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-card-copy small { font-size: 14px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-lib-filter, .nx-lib-back, .nx-lib-feedback-open, .nx-lib-pdf, .nx-lib-save, .nx-lib-more-menu button, .nx-lib-feedback-actions button) { font-size: 15px; min-height: 46px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-tabs button { font-size: 16px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-lib-takeaways li, .nx-lib-chapter) { font-size: 16px; min-height: 50px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-video-head { flex-wrap: wrap; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-video-head h1 { font-size: clamp(32px, 2.4vw, 42px); max-width: 38ch; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-lib-player-controls button, .nx-lib-reactions button) { min-height: 46px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-player-controls { grid-template-columns: 46px minmax(0, 1fr) auto 46px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-player-controls button { width: 46px; }
  #nexus-cabinet-demo #nx-cabinet-shell :is(.nx-lib-panel, .nx-lib-chapters) { line-height: 1.6; }
}

@media (min-width: 1280px) and (max-width: 1599px) {
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ts-workspace { grid-template-columns: minmax(0, 1fr); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ts-summary { position: static; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-ts-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-rm-card-deck { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-lib-feature-copy { flex-wrap: wrap; gap: 18px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-passport-copy > strong { font-size: 34px; }
}

/* Account actions remain reachable in the mobile player workspace. */
@media (max-width: 760px) {
  #nexus-cabinet-demo #nx-cabinet-shell .nx-topbar { display: flex; justify-content: flex-end; min-height: 58px; padding: 8px 16px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-topbar .nx-system-code { display: none; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-account { min-width: 0; max-width: 100%; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-account summary { min-height: 44px; }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-topbar .nx-account-name { display: block; max-width: calc(100vw - 130px); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-account-popover { max-width: calc(100vw - 32px); }
  #nexus-cabinet-demo #nx-cabinet-shell .nx-account-popover button { min-height: 44px; font-size: 14px; }
}
