/* Shared sizing only. Page styles continue to own colours, artwork and composition. */
@media screen {
  html.site-root {
    --site-font: Arial, Helvetica, sans-serif;
    --site-content-max: 1170px;
    --site-gutter: 32px;
    --site-header-height: 90px;
    --site-logo-width: 204px;
    --ui-max: var(--site-content-max);
    font-family: var(--site-font);
    font-size: 100%;
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html.site-root body {
    font-family: var(--site-font);
    font-size: 1rem;
    line-height: 1.5;
  }

  /* These are outer page frames, never the narrower cards or reading columns. */
  html.site-root.site-layout body :is(.wrap, .container, .support-width, .account-shell, .mt-main, .p1-workspace) {
    width: calc(100% - var(--site-gutter) * 2);
    max-width: var(--site-content-max);
    margin-inline: auto;
  }

  html.site-root.site-layout body :is(main.container, main.account-shell, main.mt-main, main.p1-workspace) {
    padding-inline: 0;
  }

  html.site-root.site-layout body :is(.header, .site-header) {
    height: var(--site-header-height);
  }

  html.site-root.site-layout body :is(.header, .header-inner) {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
  }

  html.site-root.site-layout body :is(.header, .site-header) .brand {
    display: block;
    width: var(--site-logo-width);
    flex: 0 0 var(--site-logo-width);
  }

  html.site-root.site-layout body :is(.header, .site-header) .brand img {
    display: block;
    width: 100%;
    height: auto;
  }

  html.site-root.site-layout body :is(.header nav, .main-nav) {
    align-items: center;
    gap: 18px;
    margin-left: auto;
    font-family: var(--site-font);
    font-size: .875rem;
    line-height: 1.4;
  }

  html.site-root.site-layout body :is(.header nav, .main-nav) > :is(a, button),
  html.site-root.site-layout body :is(.header nav, .main-nav) > .community-menu > summary {
    font-family: inherit;
    font-size: .875rem;
    line-height: 1.4;
  }

  html.site-root.site-layout body :is(.header, .site-header) .community-menu > div > a {
    font-size: .875rem;
    line-height: 1.4;
  }

  html.site-root.site-layout body .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
  }

  html.site-root.site-layout body .header-actions .icon-button {
    min-width: 40px;
    min-height: 40px;
    padding: 4px;
    font-size: 1.5rem;
    line-height: 1;
  }

  html.site-root.site-layout body .header-actions .icon {
    width: 21px;
    height: 21px;
  }

  html.site-root.site-layout body .header-actions .profile {
    min-width: 0;
    max-width: 136px;
    gap: 8px;
    font-size: .875rem;
    line-height: 1.4;
  }

  html.site-root.site-layout body .header-actions .profile > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html.site-root.site-layout body .header-actions .avatar {
    width: 32px;
    height: 32px;
  }

  html.site-root.site-layout body .header-actions .profile .icon {
    width: 12px;
    height: 12px;
  }

  .mobile-header-services {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #dce7ee;
  }

  .mobile-header-services .member-services > div {
    left: 0;
    right: auto;
    max-width: calc(100vw - 72px);
  }

  /* Utility banners use one title scale; the large editorial heroes keep theirs. */
  html.site-root.site-layout :is(.account-hero, .support-hero, .pt-hero, .add-hero, .cj-hero, .mt-hero) h1 {
    font-size: 1.875rem;
    line-height: 1.2;
  }

  html.site-root.site-layout :is(.account-hero, .support-hero, .pt-hero, .add-hero, .cj-hero, .mt-hero) p:not(.handwritten):not(.pt-hand) {
    font-size: 1rem;
    line-height: 1.5;
  }

  html.site-root.site-layout :is(.add-hero, .cj-hero, .mt-hero) {
    height: auto;
    min-height: 168px;
  }

  html.site-root.site-layout :is(.add-hero, .cj-hero, .mt-hero) > .container {
    padding-top: 20px;
    padding-bottom: 24px;
  }

  html.site-root.site-layout :is(.add-editor, .add-preview-heading, .cj-columns, .mt-content .section-heading, .mt-heading) h2 {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  html.site-root.site-layout :is(.add-editor, .cj-columns) :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=range]) {
    font-family: var(--site-font);
    font-size: 1rem;
  }
}

@media screen and (min-width: 1161px) {
  html.site-root.site-layout body :is(.header nav, .main-nav) {
    display: flex;
  }

  html.site-root.site-layout body .header-actions .menu-toggle {
    display: none;
  }
}

@media screen and (max-width: 1160px) {
  html.site-root { --site-logo-width: 204px; }

  html.site-root.site-layout body :is(.header nav, .main-nav) {
    display: none;
  }

  html.site-root.site-layout body :is(.header nav.open, .main-nav.open) {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    margin: 0;
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    background: #fff;
    color: var(--ui-ink, #062651);
    border-radius: 12px;
    box-shadow: 0 10px 30px #05264520;
    z-index: 60;
  }

  html.site-root.site-layout body .header-actions .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media screen and (min-width: 701px) {
  html.site-root.site-layout .mt-main {
    grid-template-columns: var(--ui-sidebar, 228px) minmax(0, 1fr);
  }
}

@media screen and (max-width: 760px) {
  html.site-root {
    --site-gutter: 16px;
    --site-header-height: 78px;
    --site-logo-width: 180px;
  }

  html.site-root.site-layout body :is(.header, .header-inner) { gap: 12px; }
  html.site-root.site-layout body .header-actions { gap: 6px; }

  html.site-root.site-layout :is(.account-hero, .support-hero, .pt-hero, .add-hero, .cj-hero, .mt-hero) h1 {
    font-size: 1.75rem;
  }
}

@media screen and (max-width: 420px) {
  html.site-root { --site-logo-width: 136px; }
  html.site-root.site-layout body :is(.header, .header-inner) { gap: 8px; }
  html.site-root.site-layout body .header-actions { gap: 4px; }
}
