/* Chagua mobile layer — phones and small tablets */
@media (max-width: 900px) {
  .c27-main-header.header {
    min-height: 56px !important;
    height: 56px !important;
  }
  .c27-main-header .header-container,
  .c27-main-header .header-top {
    min-height: 56px !important;
    height: 56px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  .c27-main-header .logo img {
    max-height: 36px !important;
    width: auto !important;
  }
  .c27-main-header.is-chg-hidden {
    transform: translateY(-110%);
    transition: transform .22s ease;
  }
  .c27-main-header {
    transition: transform .22s ease;
    z-index: 40;
  }

  /* Collapse the big election mood block into a one-line strip */
  .cht-mood-block {
    padding: 0 !important;
    min-height: 0 !important;
  }
  .cht-mood-inner {
    padding: 6px 12px 8px !important;
  }
  .cht-mood-eyebrow,
  .cht-mood-desc,
  .cht-mood-units,
  .cht-mood-to,
  .cht-mood-links,
  .cht-mood-polls,
  .cht-mood-toggle,
  .cht-mood-title {
    display: none !important;
  }
  .cht-mood-head {
    margin: 0 !important;
  }
  .cht-mood-count {
    display: none !important;
  }
  body.cht-has-bar {
    --chg-strip: 36px;
  }

  #chg-count-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #016B3F;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 12px;
    position: sticky;
    top: 56px;
    z-index: 35;
    letter-spacing: .01em;
  }
  .c27-main-header.is-chg-hidden + * #chg-count-strip,
  body.chg-head-hidden #chg-count-strip {
    top: 0;
  }
  #chg-count-strip span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #chg-count-strip button,
  #chg-count-strip a {
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
  }

  /* Profile thumb bar sits above the Chagua footer tab bar */
  #chg-profile-bar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 64px;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    background: #fff;
    border: 1px solid #d7e4dc;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0,0,0,.12);
    padding: 6px;
  }
  #chg-profile-bar a,
  #chg-profile-bar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    color: #016B3F;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 6px 2px;
    line-height: 1.15;
    text-align: center;
  }
  body.single-job_listing {
    padding-bottom: 130px;
  }

  /* Hide overlapping floats on profiles */
  body.single-job_listing .chp-float,
  body.single-job_listing [class*="report"][style*="fixed"],
  body.single-job_listing .ally-lang,
  body.chp-candidate-page .floating-action,
  body.chp-candidate-page .cht-lang-fab {
    display: none !important;
  }

  body.single-job_listing .profile-section,
  body.single-job_listing .listing-tab,
  body.single-job_listing .block-container > .block-type,
  body.chp-candidate-page section {
    border-bottom: 1px solid #e8ece9;
  }

  /* Ballot-first home */
  #chg-ballot-first {
    margin: 10px 12px 16px;
    background: #fff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 22px rgba(1,107,63,.08);
    border: 1px solid #e3eae6;
  }
  #chg-ballot-first h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #016B3F;
  }
  #chg-ballot-first select,
  #chg-ballot-first button {
    width: 100%;
    margin: 6px 0;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #cfe0d6;
    padding: 8px 12px;
    font-size: 16px;
  }
  #chg-ballot-first button {
    background: #016B3F;
    color: #fff;
    border: 0;
    font-weight: 700;
  }

  /* Filter sheet */
  #chg-filter-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-radius: 18px 18px 0 0;
    z-index: 60;
    max-height: 78vh;
    overflow: auto;
    transform: translateY(110%);
    transition: transform .25s ease;
    box-shadow: 0 -12px 40px rgba(0,0,0,.2);
    padding: 16px 16px 90px;
  }
  #chg-filter-sheet.open { transform: translateY(0); }
  #chg-filter-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 59; display: none;
  }
  #chg-filter-backdrop.open { display: block; }
  .chg-filter-actions {
    display: flex; gap: 8px; position: sticky; bottom: 0; background: #fff; padding-top: 10px;
  }
  .chg-filter-actions button {
    flex: 1; min-height: 44px; border-radius: 999px; font-weight: 700; border: 1px solid #cfe0d6; background: #fff;
  }
  .chg-filter-actions .apply { background: #016B3F; color: #fff; border: 0; }

  /* Account 2x2 */
  body.woocommerce-account .woocommerce-MyAccount-navigation ul,
  body.page-template-dashboard .quick-actions,
  .dashboard-quick-links {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  body.woocommerce-account .woocommerce-MyAccount-navigation li,
  .dashboard-quick-links a {
    margin: 0 !important;
  }
  .chg-stats-fold { display: none; }
  .chg-stats-fold.open { display: block; }

  /* Install / lite chips */
  #chg-install-bar {
    margin: 8px 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  #chg-install-bar button {
    border: 1px solid #cfe0d6;
    background: #fff;
    color: #016B3F;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 13px;
  }
}

@media (min-width: 901px) {
  #chg-count-strip,
  #chg-profile-bar,
  #chg-ballot-first,
  #chg-filter-sheet,
  #chg-filter-backdrop,
  #chg-install-bar { display: none !important; }
}
