/* =====================================================================
 * detect.ac — MOBILE-ONLY OVERRIDES
 * ---------------------------------------------------------------------
 * This stylesheet exclusively contains @media (max-width: ...) rules so
 * that the DESKTOP layout (>= 1025px) is never affected.  Loaded last on
 * every template, it overrides any inline styles or earlier rules.
 * =====================================================================
 */

/* ====================================================================
 * 1.  GLOBAL — applies to every page (nav, footer, body, loaders)
 * ==================================================================== */

@media (max-width: 1024px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden !important;
    }

    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    img, video, iframe, svg {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 900px) {
    /* ---- Universal NAV / hamburger drawer (covers main.css, tools.css,
       privacy.css, tos.css, docs.css, changelogs inline) ---- */

    nav, .navbar {
        padding: 0.75rem 1rem !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        height: auto !important;
        min-height: 60px;
    }

    .hamburger {
        display: flex !important;
        flex-direction: column;
        cursor: pointer;
        padding: 8px;
        gap: 4px;
        order: 3;
        background: transparent;
        border: 0;
        z-index: 1100;
    }

    .hamburger span {
        display: block;
        width: 26px;
        height: 3px;
        background: #ffffff;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.2s ease;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Slide-in mobile drawer */
    .nav-links {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        left: auto !important;
        bottom: 0 !important;
        width: 82% !important;
        max-width: 360px;
        height: 100vh !important;
        background: rgba(5, 5, 5, 0.97) !important;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid rgba(35, 238, 117, 0.18);
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        padding: 5rem 1.5rem 2rem !important;
        margin: 0 !important;
        transition: right 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
        overflow-y: auto;
        z-index: 1050;
        box-shadow: -20px 0 40px rgba(0, 0, 0, 0.35);
    }

    .nav-links.active {
        right: 0 !important;
    }

    .nav-links a {
        display: block;
        margin: 0 !important;
        padding: 0.9rem 0.5rem !important;
        font-size: 1.05rem !important;
        text-align: left !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        color: #ffffff !important;
    }

    .nav-links a::after {
        display: none !important;
    }

    .nav-buttons {
        margin: 1.25rem 0 0 0 !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
        max-width: none !important;
    }

    .nav-buttons a,
    .nav-buttons .login-btn,
    .nav-buttons .dashboard-btn {
        width: 100% !important;
        margin: 0 !important;
        text-align: center !important;
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem !important;
    }

    /* Scroll-lock helper when drawer open */
    body.nav-open {
        overflow: hidden;
    }

    /* Logo / brand sizing in mobile nav bar */
    .logo,
    .nav-brand,
    .navbar .brand-text {
        font-size: 1.3rem !important;
    }
}

/* ====================================================================
 * 2.  HOME PAGE (templates/home_page.html ↔ static/css/main.css)
 * ==================================================================== */

@media (max-width: 1024px) {
    /* Pricing grid — 2 columns on tablets */
    .pricing-grid-modern {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        padding: 0 1.25rem !important;
    }

    /* Hero — switch to vertical stack at this breakpoint */
    header .hero {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        max-width: 100% !important;
        padding: 0 1.25rem !important;
        text-align: center !important;
    }

    .hero-content,
    .hero-content h1,
    .hero-content p {
        text-align: center !important;
    }

    .hero-content h1.reveal-text {
        font-size: 3rem !important;
    }

    .cta-buttons.slide-up {
        justify-content: center !important;
    }

    /* Hide the floating user/scan stat cards on tablets too — they
       overlap the hero on narrow viewports */
    .user-count,
    .scan-count {
        display: none !important;
    }

    /* Affiliate notification trim */
    .affiliate-notification {
        padding: 10px 14px !important;
    }
}

@media (max-width: 768px) {
    /* HEADER (hero) — full-bleed mobile layout */
    header {
        min-height: auto !important;
        height: auto !important;
        padding: 7.5rem 0 3rem !important;
        display: block !important;
    }

    header .hero {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.75rem !important;
        padding: 0 1rem !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    .hero-content {
        order: 1 !important;
    }
    .hero-video {
        order: 2 !important;
        width: 100% !important;
        border-radius: 16px !important;
    }

    .hero-content h1.reveal-text {
        font-size: 2.25rem !important;
        line-height: 1.15 !important;
        margin-bottom: 1rem !important;
        letter-spacing: -0.01em !important;
    }
    .hero-content p.fade-in {
        font-size: 1rem !important;
        line-height: 1.55 !important;
        margin-bottom: 1.75rem !important;
    }
    .cta-buttons.slide-up {
        flex-direction: column !important;
        gap: 0.85rem !important;
        align-items: stretch !important;
    }
    .cta-buttons.slide-up .btn {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.95rem 1.25rem !important;
        font-size: 1rem !important;
        justify-content: center;
    }

    .scroll-arrow {
        display: none !important;
    }

    /* Affiliate notification — single line summary on phones */
    .affiliate-notification {
        padding: 8px 12px !important;
    }
    .affiliate-content {
        flex-wrap: wrap;
        gap: 8px !important;
    }
    .affiliate-text {
        flex: 1 1 100%;
    }
    .affiliate-main {
        font-size: 13px !important;
    }
    .affiliate-sub {
        font-size: 11px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .affiliate-btn {
        flex: 0 0 auto;
        padding: 6px 12px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    /* SECTIONS general padding */
    section {
        padding: 4rem 1rem 3rem !important;
    }

    .section-title {
        font-size: 2rem !important;
        text-align: center !important;
    }
    .section-subtitle {
        font-size: 0.95rem !important;
        padding: 0 0.5rem !important;
    }

    /* ABOUT section */
    #about {
        padding: 4rem 0 !important;
    }
    .about-container {
        padding: 0 1rem !important;
    }
    .about-title.section-title {
        font-size: 2rem !important;
    }
    .about-hero {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    #about .about-text-card {
        padding: 1.5rem !important;
        border-radius: 16px !important;
    }
    #about .about-description {
        font-size: 0.98rem !important;
        line-height: 1.6 !important;
    }
    #about .about-subtitle {
        font-size: 1.15rem !important;
    }
    #about .about-key-points {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    #about .about-key-points li {
        padding: 0.95rem 1rem !important;
    }
    #about .detect-compare-table {
        min-width: 0 !important;
        font-size: 0.82rem !important;
    }
    #about .detect-compare-table th,
    #about .detect-compare-table td {
        padding: 0.6rem 0.65rem !important;
    }
    .about-features {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .feature-item {
        padding: 1.5rem !important;
    }
    .stats {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .stat {
        padding: 1.75rem 1.25rem !important;
    }
    .stat h3 {
        font-size: 2rem !important;
    }

    /* GAMES SUPPORTED grid */
    .games-supported-container {
        padding: 0 1rem !important;
    }
    .games-supported-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.9rem !important;
    }
    .game-card,
    .game-card.fivem,
    .game-card.minecraft {
        grid-column: span 1 !important;
        height: 130px !important;
    }
    .game-card-content {
        padding: 1rem !important;
    }
    .game-card i {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
    .game-card span {
        font-size: 0.85rem !important;
    }
    .games-stats {
        flex-direction: column !important;
        gap: 1.25rem !important;
        padding: 1.25rem !important;
    }
    .games-stats .stat-number {
        font-size: 1.85rem !important;
    }

    /* TESTIMONIALS */
    .testimonials-container {
        padding: 0 1rem;
    }
    .testimonials-container .section-title {
        font-size: 2rem !important;
        margin-bottom: 1.75rem !important;
    }
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 !important;
    }
    .testimonial-video-container {
        padding: 1rem !important;
        border-radius: 18px !important;
    }
    .testimonial-video-container > div:first-child {
        gap: 0.65rem !important;
    }
    .testimonial-video-container img[alt][loading="lazy"] {
        width: 46px !important;
        height: 46px !important;
    }
    .testimonial-video-container .testimonial-video-wrapper {
        border-radius: 12px !important;
    }
    .testimonials-grid-wrap:not(.expanded) {
        -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 120px), transparent 100%);
        mask-image: linear-gradient(to bottom, #000 calc(100% - 120px), transparent 100%);
    }
    .testimonials-see-more-btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.95rem !important;
    }

    /* PRICING grid */
    .pricing-hero {
        padding: 0 1rem !important;
        margin-bottom: 2rem !important;
    }
    .pricing-hero h2 {
        font-size: 2rem !important;
    }
    .pricing-hero p {
        font-size: 1rem !important;
    }
    .pricing-grid-modern {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
        padding: 0 1rem !important;
    }
    .pricing-card-modern {
        padding: 1.5rem !important;
        min-height: 0 !important;
    }
    .pricing-card-modern h3 {
        font-size: 1.25rem !important;
    }
    .pricing-card-modern > div:nth-child(2) > div:first-child {
        font-size: 2rem !important;
    }
    .pricing-card-modern a,
    .pricing-card-modern button {
        padding: 0.85rem 1.25rem !important;
        font-size: 0.95rem !important;
    }
    .pricing-card-modern > div[style*="position: absolute"][style*="top: -12px"] {
        right: 14px !important;
        font-size: 0.7rem !important;
        padding: 0.3rem 0.7rem !important;
    }

    /* Enterprise modal */
    #enterpriseContactModal > div {
        padding: 1.5rem !important;
        width: 92% !important;
    }

    /* FOOTER */
    footer {
        padding: 3rem 1rem 1.5rem !important;
    }
    .footer-content {
        grid-template-columns: 1fr !important;
        display: grid !important;
        gap: 2rem !important;
        text-align: center;
    }
    .footer-section {
        text-align: center;
    }
    .footer-section h4 {
        font-size: 1.05rem !important;
    }
    .footer-section a {
        font-size: 0.95rem !important;
        padding: 0.35rem 0;
    }
    .footer-bottom {
        padding-top: 1.5rem !important;
    }

    /* Reduce decorative noise */
    .circle, .blur-circle {
        opacity: 0.08 !important;
        filter: blur(40px) !important;
    }
    .grid-overlay {
        opacity: 0.55;
    }
}

@media (max-width: 480px) {
    /* Tighter hero on small phones */
    .hero-content h1.reveal-text {
        font-size: 1.9rem !important;
    }
    .hero-content p.fade-in {
        font-size: 0.92rem !important;
    }

    .section-title {
        font-size: 1.7rem !important;
    }

    .games-supported-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.7rem !important;
    }
    .game-card,
    .game-card.fivem,
    .game-card.minecraft {
        height: 110px !important;
    }
    .game-card i {
        font-size: 1.7rem !important;
    }
    .game-card span {
        font-size: 0.78rem !important;
    }

    .stat h3 {
        font-size: 1.7rem !important;
    }

    .testimonials-grid {
        gap: 0.85rem !important;
    }
    .testimonial-video-container {
        padding: 0.85rem !important;
    }

    .pricing-card-modern > div:nth-child(2) > div:first-child {
        font-size: 1.7rem !important;
    }

    #about .about-title.section-title {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 360px) {
    .hero-content h1.reveal-text {
        font-size: 1.7rem !important;
    }
    .games-supported-grid {
        grid-template-columns: 1fr !important;
    }
    .game-card,
    .game-card.fivem,
    .game-card.minecraft {
        height: 100px !important;
    }
}

/* ====================================================================
 * 3.  DOCS PAGE (templates/docs.html ↔ static/css/docs.css)
 * ==================================================================== */

@media (max-width: 1024px) {
    body > .container > header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 14px 16px !important;
    }
    body > .container > header h1 {
        font-size: 1.2rem !important;
    }

    .content-wrapper {
        flex-direction: column !important;
        min-height: 0 !important;
    }

    .sidebar {
        width: 100% !important;
        position: static !important;
        height: auto !important;
        max-height: 55vh;
        border-right: none !important;
        border-bottom: 2px solid var(--green, #23ee75);
        padding: 14px !important;
        top: 0 !important;
        overflow-y: auto;
    }

    /* Restore vertical stack — the existing docs.css mobile rule
       forces .sidebar-nav into horizontal flex which produces a
       broken side-scrolling navigation strip on phones. */
    .sidebar-nav {
        display: block !important;
        overflow-x: visible !important;
        gap: 0 !important;
    }
    .sidebar-nav ul {
        display: block !important;
        gap: 0 !important;
    }
    .sidebar-nav li {
        margin-bottom: 4px !important;
        white-space: normal !important;
    }
    .sidebar-section {
        margin-bottom: 10px !important;
    }

    main#documentArea {
        padding: 24px 16px !important;
        padding-top: 24px !important;
        scroll-padding-top: 130px !important;
    }

    .doc-section {
        margin-bottom: 32px !important;
        padding-bottom: 20px !important;
    }
    .doc-section h2 {
        font-size: 1.5rem !important;
        margin-bottom: 14px !important;
    }
    .doc-section h3 {
        font-size: 1.2rem !important;
    }
    .doc-section h4 {
        font-size: 1.05rem !important;
    }
    .doc-section p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }

    .method-grid,
    .sdk-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .method-card,
    .sdk-card {
        padding: 16px !important;
    }

    .rate-limit-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .rate-limit-table th,
    .rate-limit-table td {
        padding: 10px !important;
        font-size: 0.85rem !important;
    }

    .code-block pre {
        font-size: 0.8rem !important;
        padding: 14px !important;
    }

    .full-view-btn {
        font-size: 0.9rem !important;
        padding: 10px 14px !important;
    }

    .section-header {
        padding: 10px 12px !important;
    }
    .section-title {
        font-size: 0.95rem !important;
    }
    .sidebar-link {
        font-size: 0.88rem !important;
        padding: 6px 10px !important;
    }
}

@media (max-width: 600px) {
    .sidebar {
        max-height: 50vh;
    }
    body > .container > header {
        padding: 10px 12px !important;
    }
    body > .container > header h1 {
        font-size: 1.05rem !important;
    }
    main#documentArea {
        padding: 16px 12px !important;
    }
}

/* ====================================================================
 * 4.  TOOLS PAGE (templates/tools.html ↔ static/css/tools.css)
 * ==================================================================== */

@media (max-width: 900px) {
    .tools-container {
        padding: 2.5rem 1rem 3.5rem !important;
    }
    .tools-header {
        margin-bottom: 1.75rem !important;
    }
    .tools-title {
        font-size: 1.85rem !important;
    }
    .tools-subtitle {
        font-size: 0.95rem !important;
    }

    /* Re-layout the search bar so the tool-count pill drops below
       on phones — the desktop arrangement breaks at narrow widths. */
    .tools-controls {
        margin-bottom: 1.75rem !important;
    }
    .search-wrapper {
        position: relative;
    }
    .search-input {
        padding: 0.95rem 2.75rem 0.95rem 2.75rem !important;
        font-size: 0.95rem !important;
    }
    .search-clear {
        right: 0.6rem !important;
    }
    .tool-count {
        position: static !important;
        transform: none !important;
        display: inline-block;
        margin-top: 0.65rem !important;
        font-size: 0.75rem !important;
    }

    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .tool-card,
    .tool-card-featured {
        grid-column: 1 / -1 !important;
        padding: 1.25rem !important;
    }
    .tool-card-featured .tool-name {
        font-size: 1.2rem !important;
    }
    .tool-card-featured .tool-desc {
        font-size: 0.9rem !important;
    }
    .tool-icon,
    .tool-card-featured .tool-icon {
        width: 42px !important;
        height: 42px !important;
        font-size: 1rem !important;
    }
    .tool-name {
        font-size: 1.05rem !important;
    }
    .tool-desc {
        font-size: 0.88rem !important;
    }
    .tool-short-url {
        font-size: 0.72rem !important;
        padding: 0.4rem 0.7rem !important;
    }
    .tool-download-btn,
    .tool-download-btn-featured {
        max-width: 100% !important;
        padding: 0.7rem 1rem !important;
        font-size: 0.85rem !important;
    }
}

@media (max-width: 480px) {
    .tools-title {
        font-size: 1.55rem !important;
        letter-spacing: -0.5px !important;
    }
    .tool-card,
    .tool-card-featured {
        padding: 1rem !important;
    }
}

/* ====================================================================
 * 5.  PRIVACY / TOS PAGES
 *     (templates/privacy.html ↔ static/css/privacy.css,
 *      templates/tos.html     ↔ static/css/tos.css)
 * ==================================================================== */

@media (max-width: 900px) {
    .content-container {
        padding: 90px 1rem 2.5rem !important;
        max-width: 100% !important;
    }
    .content-box {
        padding: 1.5rem !important;
        border-radius: 16px !important;
    }
    .content-box h2 {
        font-size: 1.7rem !important;
        margin-bottom: 1.5rem !important;
        letter-spacing: -0.5px !important;
    }
    .tos-content {
        line-height: 1.7 !important;
    }
    .tos-content section {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    .tos-content h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.65rem !important;
    }
    .tos-content p {
        font-size: 0.92rem !important;
        line-height: 1.6 !important;
    }
    .tos-content li {
        font-size: 0.92rem !important;
    }
    .last-updated {
        margin-top: 2rem !important;
        padding-top: 1.25rem !important;
        font-size: 0.82rem !important;
    }
}

@media (max-width: 480px) {
    .content-box h2 {
        font-size: 1.45rem !important;
    }
    .tos-content h3 {
        font-size: 1rem !important;
    }
    .tos-content p,
    .tos-content li {
        font-size: 0.88rem !important;
    }
}

/* TOS page has no <nav> — make sure the content container still
   has reasonable top padding when there's no nav above it. */
@media (max-width: 900px) {
    body > .content-container:first-child,
    body > .content-container:first-of-type {
        padding-top: 2rem !important;
    }
}

/* ====================================================================
 * 6.  CHANGELOGS PAGE (templates/changelogs.html, inline styles)
 * ==================================================================== */

@media (max-width: 900px) {
    .navbar {
        padding: 0.85rem 1rem !important;
        flex-direction: row !important;
    }

    /* The changelogs page declares its own .nav-links absolute dropdown;
       force it to look identical to the other pages' slide-in drawer. */
    .navbar .nav-links {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        left: auto !important;
        bottom: 0 !important;
        width: 82% !important;
        max-width: 360px;
        height: 100vh !important;
        background: rgba(5, 5, 5, 0.97) !important;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding: 5rem 1.5rem 2rem !important;
        border-left: 1px solid rgba(57, 222, 127, 0.18);
        gap: 0 !important;
        transition: right 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
        display: flex !important;
        z-index: 1050;
    }
    .navbar .nav-links.active {
        right: 0 !important;
    }
    .navbar .nav-links a {
        margin: 0 !important;
        padding: 0.9rem 0.5rem !important;
        font-size: 1.05rem !important;
        text-align: left !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        color: #ffffff !important;
    }
    .navbar .nav-buttons {
        flex-direction: column !important;
        margin-top: 1.25rem !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    .navbar .nav-buttons a {
        width: 100% !important;
        text-align: center !important;
        padding: 0.85rem 1rem !important;
    }

    .container {
        padding: 1.25rem 1rem !important;
    }
    .page-header {
        padding: 1.25rem 0 !important;
        margin-bottom: 2rem !important;
    }
    .page-title {
        font-size: 2rem !important;
    }
    .page-subtitle {
        font-size: 1rem !important;
        margin-bottom: 1.25rem !important;
    }
    .version-badge {
        padding: 0.55rem 1.1rem !important;
        font-size: 0.82rem !important;
    }

    .changelog-item {
        padding: 1.25rem !important;
        border-radius: 16px !important;
    }
    .version-info {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.65rem !important;
        margin-bottom: 1rem !important;
    }
    .version-info h2 {
        font-size: 1.4rem !important;
    }
    .version-meta {
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    .release-date {
        font-size: 0.82rem !important;
    }
    .version-tag {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.6rem !important;
    }

    .changes {
        gap: 1rem !important;
    }
    .change-category {
        padding: 1rem !important;
        border-radius: 10px !important;
    }
    .change-category h3 {
        font-size: 1rem !important;
        margin-bottom: 0.65rem !important;
    }
    .change-category li {
        font-size: 0.9rem !important;
        line-height: 1.55 !important;
        padding: 0.55rem 0 0.55rem 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.65rem !important;
    }
    .changelog-item {
        padding: 1rem !important;
    }
    .version-info h2 {
        font-size: 1.2rem !important;
    }
}

/* ====================================================================
 * 7.  ERROR PAGE (templates/error/error.html)
 * ==================================================================== */

@media (max-width: 768px) {
    .error-card {
        padding: 1.75rem 1.25rem !important;
        border-radius: 18px !important;
    }
    .error-code {
        font-size: 2.5rem !important;
    }
    .error-title {
        font-size: 1.2rem !important;
    }
    .error-message {
        font-size: 0.92rem !important;
    }
    .error-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
    }
    .action-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem !important;
    }
    .error-details {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .detail-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
    }
    .detail-value {
        text-align: left !important;
        max-width: 100% !important;
    }
}

/* ====================================================================
 * 8.  CLOUDFLARE PAGES (templates/cloudflare/*.html)
 * ==================================================================== */

@media (max-width: 600px) {
    body > .container {
        padding: 16px !important;
        max-width: 100% !important;
    }
    body > .container h1 {
        font-size: 1.6rem !important;
    }
    body > .container p {
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
    }
}

@media (max-width: 380px) {
    body > .container h1 {
        font-size: 1.35rem !important;
    }
    body > .container p {
        font-size: 0.88rem !important;
    }
}

/* ====================================================================
 * 9.  TOUCH / FORM polish
 * ==================================================================== */

@media (max-width: 900px) {
    /* Prevent iOS auto-zoom: any text-entry control must be at least 16px */
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Bigger tap targets for action buttons and links inside main content */
    .btn,
    .action-btn,
    .tool-download-btn,
    .affiliate-btn,
    .testimonials-see-more-btn,
    .pricing-card-modern a,
    .pricing-card-modern button {
        min-height: 44px;
    }
}
