/* Consensus Economics — deliberate mobile experience
   Runs after the existing responsive/page typography styles. Phone and tablet
   only; no changes to desktop navigation, editorial scale or checkout logic. */

/* Shared search-first discovery controls inside the existing navigation drawers. */
@media (max-width: 1099px) {
  .cei-mobile-country-search { margin: 0; padding: 0; }
  .cei-mobile-country-search label {
    display: block; margin: 0 0 9px; color: #153b5c;
    font-size: 13px; font-weight: 600; line-height: 1.4;
  }
  .cei-mobile-country-search__field {
    display: flex; align-items: stretch; gap: 8px; width: 100%; min-width: 0;
  }
  .cei-mobile-country-search__field input[type="search"] {
    flex: 1 1 auto; min-width: 0; width: 1px; height: 46px;
    margin: 0; padding: 0 12px; border: 1px solid #c8d9e5;
    border-radius: 8px; background: #fff; color: #1b3f5d;
    font-family: inherit; font-size: 16px; font-weight: 400;
    line-height: 1.25; box-shadow: none; appearance: none;
  }
  .cei-mobile-country-search__field input[type="search"]::placeholder { color: #7b8997; opacity: 1; }
  .cei-mobile-country-search__field button {
    flex: 0 0 auto; min-width: 58px; min-height: 46px;
    margin: 0; padding: 0 13px; border: 1px solid #153b5c;
    border-radius: 8px; background: #153b5c; color: #fff;
    font-family: inherit; font-size: 14px; font-weight: 600;
    line-height: 1.2; box-shadow: none; cursor: pointer;
  }
  .cei-mobile-discover-links { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 12px; }
  .cei-mobile-discover-links a {
    display: inline-flex; align-items: center; min-height: 44px;
    padding: 5px 0; color: #1e638d;
    font-size: 13px; font-weight: 500; line-height: 1.3;
    text-decoration: none;
  }
  .cei-mobile-discover-links a span { margin-left: 5px; }
  .cei-mobile-country-search :is(input, button):focus-visible,
  .cei-mobile-discover-links a:focus-visible {
    outline: 2px solid #2776b9; outline-offset: 3px;
  }
}

/* Phone: discovery first, navigation second, two clear actions last. */
@media (max-width: 767px) {
  html body .cei-phone-v2-panel .cei-phone-v2-scroll {
    padding: 0 16px 18px;
    overscroll-behavior: contain;
  }
  html body .cei-phone-v2-discover {
    padding: 18px 0 15px; margin: 0 0 5px;
    border-bottom: 1px solid #e3ebf1;
  }
  html body .cei-phone-v2-list > li > a {
    min-height: 52px;
    padding: 11px 6px;
    font-weight: 500;
  }
  html body .cei-phone-v2-list > li > .cei-phone-v2-submenu-toggle {
    min-height: 52px;
    height: 52px;
  }
  html body .cei-phone-v2-contact {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 46px; padding: 10px 5px; color: #42637c;
    font-size: 14px; font-weight: 500; text-decoration: none;
  }
  html body .cei-phone-v2-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  html body .cei-phone-v2-actions a,
  html body .cei-phone-v2-actions a.cei-phone-v2-report,
  html body .cei-phone-v2-actions a.cei-phone-v2-order {
    grid-column: auto; min-width: 0;
    box-sizing: border-box; width: 100%; min-height: 48px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    text-align: center; line-height: 1.2;
    white-space: normal;
  }
  html body .cei-phone-v2-actions a.cei-phone-v2-report {
    border-color: #b6d3e4; background: #f1f8fc; color: #164b71;
  }
  html body .cei-phone-v2-actions a.cei-phone-v2-order {
    border-color: #153b5c; background: #153b5c; color: #fff;
  }
  html body .cei-phone-v2-actions a:focus-visible,
  html body .cei-phone-v2-contact:focus-visible {
    outline: 2px solid #2776b9; outline-offset: 2px;
  }

  /* Publications: one column, clear actions and readable long market names. */
  .efp-page .efp-choice-grid,
  .efp-publications .forecast-card-grid,
  .efp-publications .forecast-card-detail-content { grid-template-columns: minmax(0, 1fr); }
  .efp-publications .forecast-card, .efp-publications .forecast-card-body,
  .efp-publications .forecast-card-head-copy { min-width: 0; }
  .efp-publications .forecast-card h3 {
    font-size: clamp(20px, 6.1vw, 23px);
    line-height: 1.25; overflow-wrap: anywhere;
  }
  .efp-publications .forecast-card-actions,
  .efp-publications .forecast-section-actions { gap: 10px; }
  .efp-publications .forecast-card-action,
  .efp-publications .forecast-section-actions .forecast-action {
    min-height: 46px; white-space: normal;
    line-height: 1.3;
  }
  .efp-page .efp-button { min-height: 46px; }

  /* Country discovery: horizontal region chips rather than several crowded rows. */
  .efc-page .efc-region-filters {
    display: flex; flex-wrap: nowrap; gap: 8px;
    overflow-x: auto; overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch; padding: 4px 2px 10px;
    scrollbar-width: thin;
  }
  .efc-page .efc-region-filters button {
    flex: 0 0 auto; min-height: 44px; white-space: nowrap;
  }
  .efc-page .efc-search { min-height: 48px; font-size: 16px; }
  .efc-page #efc-find-title { scroll-margin-top: 16px; }
  .efc-page .efc-letter-block a { min-height: 44px; }

  /* Simple, touch-friendly forms without altering the validation/checkout logic. */
  .registration-modern input[type="text"],
  .registration-modern input[type="email"],
  .registration-modern input[type="tel"],
  .registration-modern select,
  .registration-modern textarea,
  .order-modern-page input[type="text"],
  .order-modern-page input[type="email"],
  .order-modern-page input[type="tel"],
  .order-modern-page select,
  .order-modern-page textarea {
    max-width: 100%; min-height: 44px;
    font-size: 16px;
  }
  .registration-modern button[type="submit"],
  .registration-modern input[type="submit"],
  .order-modern-page button[type="submit"],
  .order-modern-page input[type="submit"] { min-height: 46px; }
  .registration-modern, .order-modern-page { overflow-wrap: break-word; }
}

/* Tablet: searchable country entry and links at top of the existing menu panel. */
@media (min-width: 768px) and (max-width: 1099px) {
  .cei-tablet-menu-panel__body .cei-tablet-discover {
    padding: 8px 0 15px; margin: 0 0 12px;
    border-bottom: 1px solid #e3ebf1;
  }
  .cei-tablet-menu-panel__body .cei-mobile-discover-links a { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cei-phone-v2-panel,
  .cei-phone-v2-backdrop { transition-duration: .01ms; }
}
