/* Consensus Economics — coordinated mobile/tablet UX pass.
   Loaded after the dedicated mobile experience CSS. All changes are scoped
   to <=1023px. Country listings remain fully visible without JavaScript. */
@media (max-width:1023px) {
  /* Country lists: dimensions derive from each card, rather than viewport alone. */
  .efp-publications .forecast-country-full .forecast-card-coverage {
    container: cei-coverage / inline-size;
    min-width:0;
  }
  .efp-publications .forecast-country-full .forecast-card-country-list {
    grid-template-columns:repeat(2,minmax(0,1fr));
    column-gap:clamp(13px,3vw,24px);
    row-gap:11px;
  }
  .efp-publications .forecast-country-full .forecast-country-item a {
    max-width:100%; overflow-wrap:break-word;
    font-size:14.5px; font-weight:500;
    line-height:1.42;
  }
  /* The enhancements are only activated by JS when the list exceeds 8/12
     items. Without JS the entire list remains visible. */
  .efp-publications .forecast-country-full .cei-coverage-collapsible:not(.is-expanded) .forecast-country-item:nth-child(n+9) {
    display:none;
  }
  .efp-publications .cei-coverage-toggle {
    display:inline-flex; justify-content:center; align-items:center;
    min-height:44px; padding:8px 0; margin:13px 0 0;
    border:0; background:transparent; color:#20699e;
    font-family:inherit; font-size:14px;
    font-weight:600; line-height:1.35;
    text-align:left; text-decoration:underline; text-underline-offset:3px;
    cursor:pointer;
  }
  .efp-publications .cei-coverage-toggle[hidden] { display:none; }
  .efp-publications .cei-coverage-toggle:focus-visible {
    outline:2px solid #2676af; outline-offset:3px; border-radius:3px;
  }
  /* Keep order/sample/view actions approachable without squeezing labels. */
  .efp-publications .forecast-card-actions a.forecast-card-action {
    min-height:48px; white-space:normal;
    text-wrap:pretty; line-height:1.35;
  }
  .efp-page :is(.efp-hero-actions,.efp-support-actions) a { min-height:46px; }
  /* The floating utility buttons should respect device safe areas and not
     dominate the small-screen viewport. Provide an unobstructed end-scroll. */
  .cei-cookie-settings-launcher,
  .cei-feedback-launcher {
    width:44px; height:44px;
    border-radius:12px;
  }
  .cei-cookie-settings-launcher { left:max(12px,env(safe-area-inset-left));
    bottom:calc(12px + env(safe-area-inset-bottom)); }
  .cei-feedback-launcher { top:auto; right:max(12px,env(safe-area-inset-right));
    bottom:calc(12px + env(safe-area-inset-bottom));
    transform:none; }
  .cei-cookie-settings-launcher::after,
  .cei-feedback-launcher__label { display:none; }
  /* Content can be scrolled clear of both floating controls. */
  .efp-publications, .efc-page, .country-forecast-modern .country-content-body {
    scroll-margin-bottom:70px;
  }
  /* Narrow registration/order fields remain legible and validation feedback
     stays attached to each field instead of being clipped by two-column rows. */
  .registration-modern :is(.registration-details,.registration-publications),
  .cei-order-modern-body :is(.order-modern-main,.order-summary-column) {
    min-width:0;
  }
  .registration-modern input:not([type="checkbox"]):not([type="radio"]),
  .cei-order-modern-body input:not([type="checkbox"]):not([type="radio"]),
  .registration-modern select,
  .cei-order-modern-body select {
    max-width:100%; box-sizing:border-box;
  }
  .registration-modern :is(.registration-field-error,.registration-validation-summary),
  .cei-order-modern-body :is(.order-field-error,.order-validation-summary) {
    overflow-wrap:anywhere;
  }
  /* Tablet order summary is full-width and follows the form. Avoid a cramped
     two-column mini-summary at portrait widths. */
  .cei-order-modern-body .order-summary-column,
  .order-modern-page .order-summary-column {
    position:static; grid-template-columns:minmax(0,1fr);
  }
  /* Forecast tables: JS provides a focusable horizontal-scroll region only
     where a genuine wide table exists; leave numeric data unscaled. */
  .cei-mobile-data-table-scroll {
    display:block; width:100%; max-width:100%; min-width:0;
    overflow-x:auto; overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
    border-radius:6px; scrollbar-width:thin;
  }
  .cei-mobile-data-table-scroll > table {
    width:max-content; min-width:100%; max-width:none;
    white-space:normal;
  }
  .cei-mobile-data-table-scroll:focus-visible {
    outline:2px solid #2676af; outline-offset:2px;
  }
  .cei-mobile-data-table-hint {
    margin:4px 0 9px; color:#53697c;
    font-size:12px; font-weight:400; line-height:1.4;
  }
}
@media (min-width:768px) and (max-width:1023px) {
  .efp-publications .forecast-country-full .cei-coverage-collapsible:not(.is-expanded) .forecast-country-item:nth-child(n+9) {
    display:block;
  }
  .efp-publications .forecast-country-full .cei-coverage-collapsible:not(.is-expanded) .forecast-country-item:nth-child(n+13) {
    display:none;
  }
  /* A two-column publication-card row is too narrow at 768px portrait. */
  .efp-publications .forecast-card-grid { grid-template-columns:minmax(0,1fr); }
}
@container cei-coverage (min-width:530px) {
  @media (min-width:768px) and (max-width:1023px) {
    .efp-publications .forecast-country-full .forecast-card-country-list {
      grid-template-columns:repeat(3,minmax(0,1fr));
    }
  }
}
@media (max-width:767px) {
  /* More compact home page, preserving headline and statistical hierarchy. */
  body.home .cei-home-hero { padding-top:26px; }
  body.home .cei-home-hero__proof { margin-top:24px; }
  body.home .section-publication-bg { padding-top:44px; padding-bottom:48px; }
  body.home .section-news-articles-bg { padding-top:44px; padding-bottom:44px; }
  body.home .why-consensus-section { padding-top:38px; padding-bottom:42px; }
  /* Statistics stay legible, but avoid five excessively tall stacked cards. */
  body.home .cei-home-hero__stat { padding:15px 17px; }
  /* Consistent actionable rows on long phone forms. */
  .registration-modern .registration-steps,
  .cei-order-modern-body .order-steps { max-width:100%; }
  .registration-modern :is(button[type="submit"],input[type="submit"]),
  .cei-order-modern-body :is(button[type="submit"],input[type="submit"]) {
    min-height:48px;
  }
  .efp-publications .forecast-card-actions { gap:9px; }
}
@media (max-width:359px) {
  .efp-publications .forecast-country-full .forecast-card-country-list {
    grid-template-columns:minmax(0,1fr);
  }
}
@media (prefers-reduced-motion:reduce) {
  .cei-mobile-data-table-scroll { scroll-behavior:auto; }
}
