/* v6.3: Ivy must-fixes + Lena phone height tweaks. Desktop (≥601px) unchanged. */

@media (max-width: 600px) {
  /* 1. Unselected fork/compare tabs in dark */
  html.dark .fork-tabs button,
  html.dark .mp-switcher button {
    color: #c9c6d6;
  }
  html.dark .fork-tabs button[aria-selected="true"],
  html.dark .mp-switcher button[aria-selected="true"] {
    color: #fff;
    background: var(--v62-violet, #6558E8);
  }

  /* 2. Light CTA eyebrow and integrations label contrast */
  html:not(.dark) section.cta-band .eyebrow {
    color: #6a5a8a;
  }
  html:not(.dark) section.ticker > p {
    color: #5e5a6b;
  }
  /* Dark equivalents: #a99ff7 is 7.13:1 and #c9c6d6 is 10.50:1 on #171825 */
  html.dark section.cta-band .eyebrow {
    color: #c4beff;
  }
  html.dark section.ticker > p {
    color: #c9c6d6;
  }

  /* 3. Review dots: 48×48 hit area, 12px visual via ::after */
  .review-dots button {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .review-dots button::after {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cfc8f4;
  }
  .review-dots button[aria-current="true"]::after {
    background: var(--v62-violet, #6558E8);
  }

  /* 4. Type cascade: wordmark/hub/ticker ≥12px; eyebrows ≥11px; nothing under 11px */
  .wordmark small,
  .wordtext small,
  .footer .wordmark small,
  header .wordmark small {
    font-size: 12px !important;
    letter-spacing: .08em;
    margin-top: 2px;
  }
  .eyebrow,
  p.eyebrow,
  .mp-eyebrow,
  section .section-top .eyebrow,
  .fork-top .eyebrow,
  .cta-band .eyebrow,
  .reviews .eyebrow,
  .faq .eyebrow,
  .clients .eyebrow {
    font-size: 11px !important;
    letter-spacing: .12em;
    line-height: 1.3;
  }
  .hub-k,
  section.ticker > p {
    font-size: 12px !important;
    letter-spacing: .12em;
    line-height: 1.3;
  }

  /* 6. Footer service links 48px */
  nav.footer-services a {
    min-height: 48px !important;
    height: auto !important;
    display: flex;
    align-items: center;
  }

  /* SHOULD: theme toggle and legal footer links 48px */
  .theme-toggle {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    box-sizing: border-box;
  }
  .footer > div a,
  footer.footer > div a {
    min-height: 48px !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center;
  }

  /* SHOULD: reduced-motion reviews */
  @media (prefers-reduced-motion: reduce) {
    .review-grid { scroll-behavior: auto !important; }
  }

  /* Lena: plan cards ~280px */
  #plans .mp-plan {
    min-height: 0 !important;
    padding: 16px !important;
  }
  #plans .mp-body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 2px;
  }
  #plans .mp-plan h3 {
    flex: 1 1 auto;
    text-align: left !important;
    margin: 0 !important;
    font-size: 18px;
  }
  #plans .mp-slot {
    flex: 0 1 auto;
    margin: 0 0 0 auto !important;
    text-align: right !important;
    font-size: 14px;
  }
  #plans .mp-liner {
    display: none !important;
  }
  #plans .mp-checks {
    flex: 1 0 100%;
    margin: 10px 0 0 !important;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  #plans .mp-checks li {
    font-size: 14px !important;
    line-height: 1.4;
    margin: 0 !important;
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  #plans .mp-checks li.mp-baa {
    font-size: 12px !important;
    line-height: 1.4;
    margin-top: 6px !important;
    color: #5e5a6b !important;
  }
  #plan-enterprise .mp-checks li.mp-baa,
  html.dark #plans .mp-checks li.mp-baa {
    color: #c9c6d6 !important;
  }
  #plans .mp-cta { margin-top: 12px; padding-top: 0 !important; }
  #plans .mp-btn,
  #plans .mp-cta .mp-btn {
    min-height: 48px !important;
    height: 48px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Lena: 3 bullets per fork tab (default remains With MODRN) */
  .fork-a li:nth-child(n+4),
  .fork-b li:nth-child(n+4) { display: none !important; }

  /* Lena: foundation 3 items + See all */
  .hub-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
    border: 1px solid var(--v62-line, #e8e6ef);
    background: transparent;
    color: var(--v62-violet, #6558E8);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    min-height: 48px;
  }
  html.dark .hub-more-btn { border-color: #2a2a3a; color: #a99ff7; }
  .hubviz .hub ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-template-columns: 1fr;
  }
  .hubviz .hub ul li { font-size: 14px; line-height: 1.4; }
  .hubviz .hub:not(.is-hub-open) ul li:nth-child(n+4) { display: none !important; }

  /* FAQ more button sits above items 6–8, so the control does not jump */
  .faq-more-btn {
    margin-top: 8px;
    margin-bottom: 0;
    order: 0;
  }

  /* Lena: page still long after the other cuts — 48px section padding */
  :root { --v62-pad: 48px; }
  section.clients,
  section#plans.mp-sec {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  /* BAA is a caption under the list, not another check row */
  #plans .mp-checks li.mp-baa svg { display: none !important; }

  /* SHOULD: wordmark tap target */
  .wordmark,
  .header .wordmark,
  header .wordmark,
  .footer .wordmark {
    min-height: 48px !important;
    height: auto !important;
    align-items: center;
  }
}

/* Tight 320px header: Book a call was overflowing by ~7px */
@media (max-width: 360px) {
  .header {
    padding-left: 16px !important;
    padding-right: 16px !important;
    gap: 8px;
  }
  .header .button.small {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

@media (max-width: 430px) {
  /* Lena: cap hero laptop at ~180px; do not hide it */
  .rh-dev {
    max-height: 180px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
  }
  .rh-dev img {
    max-height: 180px;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
}
