/* Readable type for the standard site. Illustrated zone, dashboard, and quiz pages keep their display type. */
html:not(:has(body.cz-page, body.ez-page, body.jp-page, body.tsz-page, body.cz-dash, body.ex-dash, body.adm-body, .desktop-game)) {
  font-size: 16px;
}

body:not(.cz-page):not(.ez-page):not(.jp-page):not(.tsz-page):not(.cz-dash):not(.ex-dash):not(.adm-body):not(:has(.desktop-game)) {
  font-size: 16px;
  line-height: 1.6;
}

body:not(.cz-page):not(.ez-page):not(.jp-page):not(.tsz-page):not(.cz-dash):not(.ex-dash):not(.adm-body):not(:has(.desktop-game)) :is(
  .form-control,
  .form-select,
  textarea
) {
  font-size: 16px;
}

.nav-pill,
.dropdown-item,
.dropdown-header,
.header-user-menu .dropdown-item,
.nav-ca-menu .dropdown-item,
.nav-updates-menu .dropdown-item,
.header-login-btn,
.mobile-bottom-nav a,
.mobile-bottom-nav span {
  font-size: 15px;
  line-height: 1.4;
}

/* Page content shell — match homepage .eh-wrap (85% centered). */
:root {
  --edclex-shell-w: 85%;
  --edclex-shell-gutter: 0px;
}

body:not(.adm-body) {
  overflow-x: clip;
}

/* Header needs more width than the 85% content shell (lang + profile collide otherwise). */
body:not(.adm-body) .header-container {
  width: min(1760px, calc(100% - 28px)) !important;
  max-width: min(1760px, calc(100% - 28px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* Shared shell targets used across public + learner pages */
body:not(.adm-body) .materials-page .container,
body:not(.adm-body) .palh-hero-grid,
body:not(.adm-body) .palh-section,
body:not(.adm-body) .palh-dash,
body:not(.adm-body) .palh-cta-panel,
body:not(.adm-body) .ts-page .shell,
body:not(.adm-body) .ts-page .ts-alert,
body:not(.adm-body) .chapter-gaming-shell,
body:not(.adm-body) .perf-report .shell,
body:not(.adm-body) .edx-dash,
body:not(.adm-body) .courses-wrapper,
body:not(.adm-body) .course-list-grid .course-list-wrap,
body:not(.adm-body) .footer-section.sf-footer .sf-inner,
body:not(.adm-body) .footer-section.sf-footer .sf-bar-inner,
body:not(.adm-body) #edclex-mentoring .ment-shell,
body:not(.adm-body) .palc-wrap,
body:not(.adm-body) .palt-wrap,
body.pal-session .pls,
body.pal-launch .pln,
body.pal-dashboard .pd,
body:not(.adm-body) .elim-page .shell,
body:not(.adm-body) #edclex-feedback .mast,
body:not(.adm-body) #edclex-feedback main,
body:not(.adm-body) #edclex-pal-guide .container,
body:not(.adm-body) #edclex-lms-guide .wrap,
body:not(.adm-body) .contact-shell,
body:not(.adm-body) .home-practice-tests-block .hptu-inner,
body:not(.adm-body) .home-exam-mode-block .hem-inner,
body:not(.adm-body) .home-level-up-block .hluu-inner,
body:not(.adm-body) .kmap .shell,
body:not(.adm-body) .deca-page,
body:not(.adm-body) .deca-wrapper,
body:not(.adm-body) .practice-shell,
body:not(.adm-body) .economics-hero .eh-wrap,
body:not(.adm-body) .lms-main,
body:not(.adm-body) .ca-kq-header__inner,
body:not(.adm-body) .ca-hero-full__inner,
body:not(.adm-body) .ca-hub,
body:not(.adm-body) .ca-hub-bottom-bar__frame,
body:not(.adm-body) .teacher-dashboard .shell,
body:not(.adm-body) main.dashboard > .shell,
body:not(.adm-body) main.page > .shell,
body.ex-dash .wrap,
body.cz-dash .wrap {
  width: var(--edclex-shell-w) !important;
  max-width: var(--edclex-shell-w) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* Current-affairs hub layout width follows the shared shell variable */
body:not(.adm-body),
body:not(.adm-body) .page-current-affairs {
  --ca-layout-width: var(--edclex-shell-w);
}

/* Tablet + phone: expand 85% shells to full width */
@media (max-width: 991.98px) {
  :root {
    --edclex-shell-w: 100%;
    --edclex-shell-gutter: 1.25rem;
  }

  body:not(.adm-body) .header-container,
  body:not(.adm-body) .materials-page .container,
  body:not(.adm-body) .palh-hero-grid,
  body:not(.adm-body) .palh-section,
  body:not(.adm-body) .palh-dash,
  body:not(.adm-body) .palh-cta-panel,
  body:not(.adm-body) .ts-page .shell,
  body:not(.adm-body) .ts-page .ts-alert,
  body:not(.adm-body) .chapter-gaming-shell,
  body:not(.adm-body) .perf-report .shell,
  body:not(.adm-body) .edx-dash,
  body:not(.adm-body) .courses-wrapper,
  body:not(.adm-body) .course-list-grid .course-list-wrap,
  body:not(.adm-body) .footer-section.sf-footer .sf-inner,
  body:not(.adm-body) .footer-section.sf-footer .sf-bar-inner,
  body:not(.adm-body) #edclex-mentoring .ment-shell,
  body:not(.adm-body) .palc-wrap,
  body:not(.adm-body) .palt-wrap,
  body.pal-session .pls,
  body.pal-launch .pln,
  body.pal-dashboard .pd,
  body:not(.adm-body) .elim-page .shell,
  body:not(.adm-body) #edclex-feedback .mast,
  body:not(.adm-body) #edclex-feedback main,
  body:not(.adm-body) #edclex-pal-guide .container,
  body:not(.adm-body) #edclex-lms-guide .wrap,
  body:not(.adm-body) .contact-shell,
  body:not(.adm-body) .home-practice-tests-block .hptu-inner,
  body:not(.adm-body) .home-exam-mode-block .hem-inner,
  body:not(.adm-body) .home-level-up-block .hluu-inner,
  body:not(.adm-body) .kmap .shell,
  body:not(.adm-body) .deca-page,
  body:not(.adm-body) .deca-wrapper,
  body:not(.adm-body) .practice-shell,
body:not(.adm-body) .economics-hero .eh-wrap,
  body:not(.adm-body) .lms-main,
  body:not(.adm-body) .ca-kq-header__inner,
  body:not(.adm-body) .ca-hero-full__inner,
  body:not(.adm-body) .ca-hub,
  body:not(.adm-body) .ca-hub-bottom-bar__frame,
  body:not(.adm-body) .teacher-dashboard .shell,
  body:not(.adm-body) main.dashboard > .shell,
  body:not(.adm-body) main.page > .shell,
  body.ex-dash .wrap,
  body.cz-dash .wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Gutters only for shells that previously relied on 85% centering (no own side pad) */
  body:not(.adm-body) .ts-page .shell,
  body:not(.adm-body) .ts-page .ts-alert,
  body:not(.adm-body) #edclex-mentoring .ment-shell,
  body:not(.adm-body) .palc-wrap,
  body:not(.adm-body) .palt-wrap,
  body.pal-session .pls,
  body.pal-launch .pln,
  body.pal-dashboard .pd,
  body:not(.adm-body) .elim-page .shell,
  body:not(.adm-body) .perf-report .shell,
  body:not(.adm-body) .edx-dash,
  body:not(.adm-body) .kmap .shell,
  body:not(.adm-body) .contact-shell,
  body:not(.adm-body) #edclex-pal-guide .container,
  body:not(.adm-body) #edclex-lms-guide .wrap,
  body:not(.adm-body) .chapter-gaming-shell,
  body:not(.adm-body) main.dashboard > .shell,
  body:not(.adm-body) main.page > .shell,
  body.ex-dash .wrap,
  body.cz-dash .wrap {
    padding-left: max(var(--edclex-shell-gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--edclex-shell-gutter), env(safe-area-inset-right, 0px));
  }
}

/* Phone: tighter gutters + room for bottom nav */
@media (max-width: 767.98px) {
  :root {
    --edclex-shell-w: 100%;
    --edclex-shell-gutter: 0.85rem;
  }

  body:not(.adm-body):has(.mobile-bottom-nav) {
    padding-bottom: max(88px, calc(72px + env(safe-area-inset-bottom, 0px)));
  }
}

/* Small phones */
@media (max-width: 400px) {
  :root {
    --edclex-shell-gutter: 0.65rem;
  }
}

/* Market status bar under the header. Home keeps its original size. */
body:not(.page-home) .kx-site-topbar {
  font-size: 14px;
  letter-spacing: 0.02em;
}

body:not(.page-home) .kx-site-topbar__inner {
  min-height: 44px;
}

body:not(.page-home) .kx-site-topbar__tick {
  font-size: 14px;
  letter-spacing: 0.01em;
}
