/*
 * HOSTDRIFT_CRM_PUBLIC_MOBILE_R1
 * Public landing responsive override only.
 */

@media (max-width: 800px) {

    .public-body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* ---------- Header ---------- */

    .public-header {
        width: calc(100% - 28px) !important;
        height: auto !important;
        min-height: 72px;
        padding: 10px 0;
        gap: 10px !important;
        flex-wrap: nowrap;
    }

    .public-header .brand {
        min-width: 0 !important;
        flex: 0 0 auto;
    }

    .public-header .brand > span:last-child {
        min-width: 0;
    }

    .public-actions {
        min-width: 0;
        margin-left: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        flex: 0 1 auto;
    }

    .public-actions a {
        min-width: 0;
        min-height: 38px;
        padding: 0 11px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: .69rem;
    }

    /* Desktop nav is intentionally hidden on mobile */
    .public-nav {
        display: none !important;
    }

    /* ---------- Hero ---------- */

    .public-hero {
        width: calc(100% - 28px) !important;
        min-width: 0 !important;
        min-height: 0 !important;

        grid-template-columns: minmax(0, 1fr) !important;

        gap: 34px !important;
        padding: 48px 0 66px !important;
    }

    .hero-copy {
        width: 100%;
        min-width: 0;
        max-width: 100% !important;
    }

    .hero-copy h1 {
        width: 100%;
        max-width: 100% !important;

        font-size: clamp(2.15rem, 10vw, 3.25rem) !important;
        line-height: 1.08 !important;
        letter-spacing: -.04em !important;

        overflow-wrap: anywhere;
        word-break: normal;
    }

    html[lang="th"] .hero-copy h1 {
        max-width: 100% !important;
        font-size: clamp(2.05rem, 9.3vw, 2.9rem) !important;
        line-height: 1.14 !important;
        letter-spacing: -.035em !important;

        overflow-wrap: anywhere;
    }

    .hero-copy p {
        width: 100%;
        max-width: 100% !important;

        font-size: .95rem !important;
        line-height: 1.75 !important;

        overflow-wrap: anywhere;
    }

    .hero-actions {
        width: 100%;
        gap: 10px !important;
        margin-top: 26px !important;
    }

    .hero-actions > a {
        min-width: 0;
        flex: 1 1 150px;
    }

    /* ---------- Shared Inbox preview ---------- */

    .product-preview {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;
        overflow: hidden !important;
        border-radius: 20px !important;
    }

    .preview-topbar {
        width: 100%;
        min-width: 0;

        gap: 10px;
        padding: 12px 14px;

        flex-wrap: wrap;
    }

    .preview-topbar > div {
        min-width: 0;
    }

    .preview-topbar strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .preview-status {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .preview-grid {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;

        grid-template-columns: minmax(0, 1fr) !important;
    }

    .preview-list,
    .preview-thread {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .preview-list {
        border-right: 0 !important;
    }

    .preview-thread {
        border-left: 0 !important;
        border-top: 1px solid var(--hd-line);
    }

    .preview-contact {
        width: 100%;
        min-width: 0;

        grid-template-columns: auto minmax(0, 1fr) auto !important;
    }

    .preview-contact > div {
        min-width: 0;
    }

    .preview-contact strong,
    .preview-contact small {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .thread-person {
        min-width: 0;
    }

    .thread-person > div {
        min-width: 0;
    }

    .thread-person strong,
    .thread-person small {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .thread-space {
        min-width: 0;
    }

    .thread-space .bubble {
        max-width: 92% !important;
        overflow-wrap: anywhere;
    }

    .preview-composer {
        width: 100%;
        min-width: 0;
    }

    /* ---------- Remaining public sections ---------- */

    .public-trust,
    .public-section,
    .public-cta,
    .public-footer {
        width: calc(100% - 28px) !important;
        max-width: 100%;
    }

    .public-trust {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }

    .feature-grid,
    .roadmap-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .section-heading {
        max-width: 100% !important;
        margin-bottom: 32px !important;
    }

    .section-heading h2,
    .public-cta h2 {
        max-width: 100% !important;
        overflow-wrap: anywhere;
    }

    .integration-section {
        box-sizing: border-box;
        max-width: 100%;
        overflow: hidden;
        padding-left: 14px;
        padding-right: 14px;
    }

    .integration-cloud {
        max-width: 100% !important;
    }

    .integration-cloud span {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .public-cta-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .public-footer {
        flex-wrap: wrap;
        gap: 16px;
    }
}


@media (max-width: 560px) {

    .public-header {
        width: calc(100% - 20px) !important;
        min-height: 64px;
        padding: 8px 0;
        gap: 7px !important;
    }

    .public-header .brand > span:last-child {
        display: none !important;
    }

    .public-header .brand-mark {
        width: 38px !important;
        height: 38px !important;
        border-radius: 12px;
    }

    .public-actions {
        gap: 5px;
    }

    .public-actions a {
        min-height: 36px;
        padding: 0 9px;
        font-size: .64rem;
    }

    .public-actions .language-switch {
        width: 36px;
        height: 36px;
        padding: 0;
    }

    .public-hero,
    .public-trust,
    .public-section,
    .public-cta,
    .public-footer {
        width: calc(100% - 24px) !important;
    }

    .public-hero {
        gap: 28px !important;
        padding: 42px 0 56px !important;
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 9.5vw, 2.65rem) !important;
    }

    html[lang="th"] .hero-copy h1 {
        font-size: clamp(1.95rem, 8.7vw, 2.45rem) !important;
        line-height: 1.16 !important;
    }

    .hero-copy p {
        font-size: .9rem !important;
        line-height: 1.72 !important;
    }

    .hero-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-actions > a {
        width: 100%;
        box-sizing: border-box;
    }

    .product-preview {
        border-radius: 18px !important;
    }

    .preview-topbar {
        padding: 11px 12px;
    }

    .preview-contact {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .thread-space {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .public-section {
        padding-top: 72px !important;
        padding-bottom: 72px !important;
    }

    .public-cta {
        padding-left: 18px !important;
        padding-right: 18px !important;
        box-sizing: border-box;
    }

    .public-cta-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .public-cta-actions > a {
        width: 100%;
        box-sizing: border-box;
    }
}


@media (max-width: 360px) {

    .public-actions a {
        padding-left: 7px;
        padding-right: 7px;
        font-size: .6rem;
    }

    .hero-copy h1,
    html[lang="th"] .hero-copy h1 {
        font-size: 1.9rem !important;
    }
}
