/* Shared mobile polish loaded with the global header. */
.mobile-home-cta {
  display: none;
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 6.5rem;
  }

  body {
    overflow-x: hidden;
  }

  a,
  button,
  summary,
  input {
    -webkit-tap-highlight-color: transparent;
  }

  .article-content {
    font-size: 0.95rem;
    line-height: 1.95;
  }

  .article-content h1 {
    font-size: 1.8rem;
    line-height: 1.5;
  }

  .article-content h2 {
    margin-top: 2.25rem;
    font-size: 1.45rem;
    line-height: 1.55;
  }

  .article-content h3 {
    margin-top: 1.75rem;
    font-size: 1.2rem;
    line-height: 1.6;
  }

  .article-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    white-space: nowrap;
    border-radius: 0.75rem;
  }

  /* Blog articles use several legacy layouts; normalize them on small screens. */
  .blog-page main {
    padding-top: 7.25rem !important;
    padding-bottom: 3rem !important;
  }

  .blog-page main > .container,
  .blog-page main > [class*="max-w-"] {
    width: 100%;
    max-width: 100%;
    padding-inline: 0.75rem !important;
  }

  .blog-page main :has(> .article-content) {
    min-width: 0;
    max-width: 100%;
    padding: 0.9rem !important;
    border-radius: 1.1rem !important;
  }

  .blog-page .article-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0 !important;
    color: #d4d4d8;
    font-size: 1rem;
    line-height: 2.05;
    overflow-wrap: anywhere;
  }

  .blog-page .article-content h1 {
    margin: 0 0 1.35rem !important;
    font-size: clamp(1.7rem, 7.8vw, 2.05rem) !important;
    line-height: 1.5 !important;
    letter-spacing: -0.015em;
    overflow-wrap: normal;
  }

  .blog-page .article-content h2 {
    align-items: flex-start;
    gap: 0.45rem;
    margin: 2.4rem 0 1rem !important;
    padding-bottom: 0.65rem;
    font-size: 1.42rem !important;
    line-height: 1.65 !important;
    overflow-wrap: normal;
  }

  .blog-page .article-content h3 {
    margin: 1.9rem 0 0.7rem !important;
    font-size: 1.18rem !important;
    line-height: 1.7 !important;
    overflow-wrap: normal;
  }

  .blog-page .article-content p {
    margin-bottom: 1.15rem !important;
    color: #c4c4cc;
    font-size: 1rem !important;
    line-height: 2.05 !important;
    text-align: right !important;
  }

  .blog-page .article-content ul,
  .blog-page .article-content ol {
    margin: 0 0 1.35rem !important;
    padding-right: 1.15rem !important;
    color: #c4c4cc;
  }

  .blog-page .article-content li {
    margin: 0 0 0.65rem !important;
    padding-right: 0.15rem;
    padding-left: 0;
    line-height: 1.95;
  }

  .blog-page .article-content li:has(ion-icon) {
    margin-right: 0 !important;
    padding-right: 0 !important;
  }

  .blog-page .article-content ion-icon {
    flex: 0 0 auto;
  }

  .blog-page .article-content img {
    width: 100%;
    height: auto;
    margin-block: 1.25rem;
    border-radius: 0.95rem !important;
    object-fit: cover;
  }

  .blog-page .article-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem;
    border-right-width: 3px;
    border-radius: 0.85rem;
    background: rgba(249, 115, 22, 0.06);
    font-size: 0.95rem;
    line-height: 2;
  }

  .blog-page .article-content pre {
    max-width: 100%;
    overflow-x: auto;
    direction: ltr;
    padding: 0.9rem;
    border-radius: 0.8rem;
  }

  .blog-page .article-content :not(pre) > code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .blog-page .article-content > div[class*="p-6"],
  .blog-page .article-content > section[class*="p-6"],
  .blog-page .article-content > aside[class*="p-6"] {
    padding: 1rem !important;
    border-radius: 1rem !important;
  }

  .blog-page .article-table-scroll {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 1.4rem 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border: 1px solid #3f3f46;
    border-radius: 0.9rem;
    background: rgba(9, 9, 11, 0.35);
    scrollbar-width: thin;
    scrollbar-color: #f97316 #27272a;
    -webkit-overflow-scrolling: touch;
  }

  .blog-page .article-table-scroll:focus-visible {
    outline: 2px solid #fb923c;
    outline-offset: 2px;
  }

  .blog-page .article-table-scroll table {
    display: table;
    width: 100%;
    min-width: 36rem;
    margin: 0 !important;
    overflow: visible;
    border: 0;
    border-radius: 0;
    white-space: normal;
  }

  .blog-page .article-table-scroll th,
  .blog-page .article-table-scroll td {
    min-width: 8.5rem;
    padding: 0.8rem;
    font-size: 0.82rem;
    line-height: 1.75;
    white-space: normal;
  }

  .blog-page .article-content a[href="/#register-form"].btn-primary-custom {
    display: inline-flex;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-height: 3.5rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem !important;
    border-radius: 0.95rem !important;
    font-size: 0.88rem !important;
    line-height: 1.7;
    text-align: center;
  }

  .blog-page .article-content :has(> a[href="/#register-form"].btn-primary-custom) {
    height: auto !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }

  .blog-page .article-content :has(> a[href="/#register-form"].btn-primary-custom) > a {
    display: inline-flex;
    flex: 0 0 100%;
    width: 100%;
    height: auto !important;
    min-height: 3.35rem;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem !important;
    text-align: center;
  }

  body.blog-page > footer {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }

  .home-page main > section:first-child {
    min-height: auto;
    padding-top: 6.65rem;
    padding-bottom: 3rem;
  }

  .home-page main > section:first-child .hero-copy {
    display: flex;
    flex-direction: column;
  }

  .home-page main > section:first-child .hero-eyebrow {
    order: 1;
    align-self: center;
  }

  .home-page main > section:first-child .hero-headline { order: 2; }
  .home-page main > section:first-child .hero-conversion-card { order: 3; }
  .home-page main > section:first-child .hero-subheadline { order: 4; }
  .home-page main > section:first-child .hero-summary { order: 5; }
  .home-page main > section:first-child .hero-secondary-actions { order: 6; }
  .home-page main > section:first-child .hero-trust-note { order: 7; }
  .home-page main > section:first-child .hero-guide-links { order: 8; }

  .home-page main > section:first-child h1 {
    margin-top: 1.15rem;
    margin-bottom: 1rem;
    font-size: clamp(1.9rem, 8.3vw, 2.35rem);
    line-height: 1.4;
  }

  .home-page main > section:first-child h2 {
    font-size: 1.08rem;
    line-height: 1.85;
  }

  .home-page main > section:first-child .hero-summary {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 2;
  }

  .home-page main > section:first-child a {
    display: inline-flex;
    min-height: 3.45rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    line-height: 1.7;
  }

  .home-page main > section:first-child aside {
    padding: 1.1rem;
    border-radius: 1.25rem;
  }

  .home-page main > section.py-20 {
    padding-block: 3.75rem;
  }

  .home-page main article.p-6 {
    padding: 1.15rem;
    border-radius: 1.15rem;
  }

  .home-page.has-mobile-cta {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }

  .mobile-home-cta {
    position: fixed;
    z-index: 65;
    right: 0.55rem;
    bottom: calc(0.55rem + env(safe-area-inset-bottom));
    left: 0.55rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem;
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 1.15rem;
    background: rgba(9, 9, 11, 0.93);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(calc(100% + 1.5rem));
    transition: opacity 180ms ease, transform 220ms ease, visibility 220ms;
  }

  .mobile-home-cta.is-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
  }

  .mobile-home-cta-copy {
    grid-column: 2;
    min-width: 0;
    padding-right: 0.25rem;
  }

  .mobile-home-cta-copy strong,
  .mobile-home-cta-copy small {
    display: block;
  }

  .mobile-home-cta-copy strong {
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.55;
  }

  .mobile-home-cta-copy small {
    overflow: hidden;
    color: #a1a1aa;
    font-size: 0.62rem;
    line-height: 1.6;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-home-cta-action {
    grid-column: 1;
    display: inline-flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #fb923c, #ea580c);
    box-shadow: 0 10px 28px rgba(234, 88, 12, 0.34);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
  }
}

@media (max-width: 360px) {
  .mobile-home-cta {
    grid-template-columns: 1fr;
  }

  .mobile-home-cta-copy {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-home-cta {
    transition: none;
  }
}
