/* Source: public/static/css/fuuvo-mobile-home.css */
@media (max-width: 920px), (hover: none) and (pointer: coarse) and (max-width: 1366px) {
    html:has(body.chat-landing),
    body.chat-landing {
        position: static !important;
        width: var(--mobile-viewport-width, 100%) !important;
        min-width: 0 !important;
        max-width: var(--mobile-viewport-width, 100%) !important;
        height: auto !important;
        min-height: 100% !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: auto !important;
        touch-action: pan-y !important;
        -webkit-overflow-scrolling: touch;
        background: #fff !important;
        scrollbar-width: thin;
        scrollbar-color: rgba(113, 128, 154, .42) transparent;
    }

    html:has(body.chat-landing)::-webkit-scrollbar,
    body.chat-landing::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    html:has(body.chat-landing)::-webkit-scrollbar-thumb,
    body.chat-landing::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(113, 128, 154, .42);
    }

    body.chat-landing .app[data-fuuvo-app-shell="1"] {
        width: var(--mobile-viewport-width, 100%) !important;
        min-width: 0 !important;
        max-width: var(--mobile-viewport-width, 100%) !important;
        height: auto !important;
        min-height: 100dvh !important;
        max-height: none !important;
        display: block !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body.chat-landing .workspace[data-fuuvo-app-workspace="1"] {
        position: relative !important;
        inset: auto !important;
        width: var(--mobile-viewport-width, 100%) !important;
        min-width: 0 !important;
        max-width: var(--mobile-viewport-width, 100%) !important;
        height: auto !important;
        min-height: 100dvh !important;
        max-height: none !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body.chat-landing .mobile-chat-topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 80 !important;
        width: 100% !important;
        min-height: 72px !important;
        padding: 0 10px !important;
        display: grid !important;
        grid-template-columns: 46px minmax(92px, 1fr) auto !important;
        align-items: center !important;
        border: 0 !important;
        background: rgba(255, 255, 255, .96) !important;
        box-shadow: none !important;
        backdrop-filter: blur(14px) !important;
    }

    body.chat-landing .mobile-nav-trigger {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        overflow: visible !important;
    }

    body.chat-landing .mobile-nav-pill {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.chat-landing .mobile-nav-bars {
        width: 22px !important;
        height: 22px !important;
        flex: 0 0 22px !important;
        color: #10284c !important;
    }

    body.chat-landing .mobile-nav-bars :is(img, svg) {
        width: 22px !important;
        height: 22px !important;
        display: block !important;
        object-fit: contain !important;
    }

    body.chat-landing .mobile-nav-title,
    body.chat-landing .mobile-chat-brand {
        display: none !important;
    }

    body.chat-landing .mobile-chat-bar {
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: visible !important;
    }

    body.chat-landing .mobile-chat-logo {
        min-width: 118px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0;
        color: #0877f9;
        line-height: 1;
        text-decoration: none;
    }

    body.chat-landing .mobile-chat-logo img {
        width: 88px;
        max-width: 88px;
        height: 26px;
        display: block;
        object-fit: contain;
        font-size: 0;
        color: transparent;
        border: 0;
    }

    body.chat-landing .mobile-chat-logo [data-fuuvo-brand-language][hidden] {
        display: none !important;
    }

    body.chat-landing .mobile-chat-brand-en {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        line-height: 1;
    }

    body.chat-landing .mobile-chat-brand-en img {
        width: 112px;
        height: 40px;
        max-width: none;
        max-height: 40px;
        flex: 0 0 112px;
        object-fit: contain;
        object-position: center;
        font-size: 0;
        color: transparent;
        border: 0;
    }

    body.chat-landing .mobile-chat-logo img.mobile-chat-brand-zh {
        width: 78px;
        height: 25px;
        max-width: 78px;
    }

    body.chat-landing .mobile-chat-actions {
        position: static !important;
        min-width: 0 !important;
        max-width: none !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    body.chat-landing .mobile-chat-link[data-safety-center-link] {
        display: none !important;
    }

    body.chat-landing .mobile-chat-actions .ui-language-switch {
        min-width: 58px !important;
        height: 34px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.chat-landing .mobile-chat-actions .ui-language-switch-btn {
        position: relative;
        min-width: 29px !important;
        height: 32px !important;
        padding: 0 6px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #71809a !important;
        -webkit-text-fill-color: currentColor !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }

    body.chat-landing .mobile-chat-actions .ui-language-switch-btn.active {
        color: #10284c !important;
        -webkit-text-fill-color: #10284c !important;
    }

    body.chat-landing .mobile-chat-actions .ui-language-switch-btn + .ui-language-switch-btn::before {
        content: "";
        position: absolute;
        left: 0;
        top: 8px;
        width: 1px;
        height: 16px;
        background: #d9e0e9;
    }

    body.chat-landing .mobile-chat-btn {
        min-width: 58px !important;
        min-height: 40px !important;
        padding: 0 15px !important;
        border: 0 !important;
        border-radius: 14px !important;
        background: #10284c !important;
        color: #fff !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        box-shadow: 0 7px 16px rgba(16, 40, 76, .16) !important;
    }

    body.chat-landing[data-mode="chat"] .hero,
    body.chat-landing[data-mode="chat"] .stage,
    body.chat-landing[data-mode="chat"] .workspace-records,
    body.chat-landing[data-mode="chat"] .workspace-chat-header,
    body.chat-landing[data-mode="chat"] .workspace-composer-anchor {
        display: none !important;
    }

    body.chat-landing[data-mode="chat"] .composer {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: calc(100dvh - 78px) !important;
        margin: 0 !important;
        padding: 43px 20px 34px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
        transform: none !important;
        flex: 0 0 auto !important;
    }

    body.chat-landing[data-mode="chat"] .composer-top {
        order: 1;
        margin: 0 0 29px !important;
        display: block !important;
        text-align: center !important;
    }

    body.chat-landing[data-mode="chat"] .composer-top > div:first-child {
        width: 100%;
    }

    body.chat-landing[data-mode="chat"] .composer-title {
        color: #10284c !important;
        font-size: clamp(26px, 7.2vw, 31px) !important;
        font-weight: 720 !important;
        line-height: 1.28 !important;
        letter-spacing: -.8px !important;
        white-space: nowrap;
    }

    body.chat-landing[data-mode="chat"] .composer-title.has-fuuvo-slogan {
        font-size: 18px !important;
        line-height: 1.35 !important;
        letter-spacing: 0 !important;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    body.chat-landing[data-mode="chat"] .composer-desc {
        margin: 14px 0 0 !important;
        display: block !important;
        color: #72819a !important;
        font-size: 17px !important;
        line-height: 1.5 !important;
        white-space: normal !important;
    }

    body.chat-landing[data-mode="chat"] .composer-top .toolbar-group,
    body.chat-landing[data-mode="chat"] .composer-actions,
    body.chat-landing[data-mode="chat"] #media-compose {
        display: none !important;
    }

    body.chat-landing[data-mode="chat"] #chat-compose-field {
        order: 2;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
    }

    body.chat-landing[data-mode="chat"] #chat-compose-field > label,
    body.chat-landing[data-mode="chat"] .chat-quick-actions,
    body.chat-landing[data-mode="chat"] .composer-capability-bar,
    body.chat-landing[data-mode="chat"] .landing-workspace-disclaimer,
    body.chat-landing[data-mode="chat"] .work-skill-bar,
    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar {
        display: none !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-wrap {
        order: 1;
        position: relative !important;
        width: 100% !important;
        min-height: 172px !important;
        height: 172px !important;
        margin: 0 !important;
        overflow: visible !important;
        border: 1px solid #d7e0eb !important;
        border-radius: 20px !important;
        background: #fff !important;
        box-shadow: 0 9px 20px rgba(23, 49, 84, .08) !important;
    }

    body.chat-landing[data-mode="chat"] .free-media-experience-notice {
        order: 2 !important;
        width: calc(100% - 12px);
        box-sizing: border-box;
        margin: 10px 6px 0;
    }

    /* The mobile landing composer is a flex column. Keep image/video
       parameters after the prompt, matching the desktop composer order. */
    body.chat-landing[data-mode="chat"] #chat-compose-field.is-media-mode > .chat-media-toolbar-host {
        order: 2 !important;
        width: 100% !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        width: 100% !important;
        min-height: 172px !important;
        height: 172px !important;
        padding: 23px 20px 70px !important;
        border: 0 !important;
        border-radius: 20px !important;
        color: #10284c !important;
        -webkit-text-fill-color: #10284c !important;
        font-size: 17px !important;
        line-height: 1.55 !important;
        resize: none !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-hint {
        top: 23px !important;
        left: 20px !important;
        right: 20px !important;
        height: auto !important;
        color: #8290a6 !important;
        font-size: 16px !important;
        line-height: 1.45 !important;
        white-space: nowrap !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-tools {
        position: absolute !important;
        left: 17px !important;
        right: 17px !important;
        bottom: 17px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    body.chat-landing[data-mode="chat"] .chat-tool-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        padding: 0 !important;
        border: 1px solid #d7e0eb !important;
        border-radius: 50% !important;
        background: #fff !important;
        color: #10284c !important;
        box-shadow: none !important;
    }

    body.chat-landing[data-mode="chat"] .chat-tool-btn svg {
        width: 23px !important;
        height: 23px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-action-group {
        margin-left: auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    body.chat-landing[data-mode="chat"] .send-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #0877f9 !important;
        color: #fff !important;
        opacity: 1 !important;
        box-shadow: 0 8px 17px rgba(8, 119, 249, .24) !important;
    }

    body.chat-landing[data-mode="chat"] .send-btn:disabled {
        background: #0877f9 !important;
        color: #fff !important;
        opacity: 1 !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities {
        order: 2;
        position: relative;
        width: 100%;
        margin-top: 18px;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities > button {
        min-width: 0;
        min-height: 38px;
        padding: 0 5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1 1 auto;
        border: 1px solid #d7e0eb;
        border-radius: 9px;
        background: #fff;
        color: #10284c;
        font: inherit;
        font-size: 11px;
        font-weight: 500;
        line-height: 1;
        white-space: nowrap;
        cursor: pointer;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities > button > .fuuvo-icon {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        background-color: transparent !important;
        background-image: var(--fuuvo-icon-url) !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        background-size: contain !important;
        -webkit-mask: none !important;
        mask: none !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capability-icon {
        width: 19px;
        height: 19px;
        flex: 0 0 19px;
        display: block;
        border: 0;
        border-radius: 0;
        background: transparent;
        object-fit: contain;
        color: #0d72f5;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capability-icon .fuuvo-linear-svg {
        width: 100%;
        height: 100%;
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities > .mobile-home-capabilities-more {
        width: 32px;
        min-width: 32px;
        padding: 0;
        flex: 0 0 32px;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities-more svg {
        width: 18px;
        height: 18px;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities-menu {
        position: absolute;
        top: calc(100% + 9px);
        right: 0;
        z-index: 95;
        width: 164px;
        padding: 7px;
        border: 1px solid #d9e1ec;
        border-radius: 11px;
        background: #fff;
        box-shadow: 0 14px 30px rgba(22, 43, 72, .16);
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities-menu.hidden {
        display: none !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities-menu button {
        width: 100%;
        min-height: 38px;
        padding: 0 11px;
        display: flex;
        align-items: center;
        border: 0;
        border-radius: 7px;
        background: transparent;
        color: #10284c;
        font: inherit;
        font-size: 14px;
        text-align: left;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities-menu button :is(img, .mobile-home-capability-icon) {
        width: 22px;
        height: 22px;
        margin-right: 9px;
        flex: 0 0 22px;
        display: block;
        border: 0;
        border-radius: 0;
        background: transparent;
        object-fit: contain;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities-menu button .mobile-home-capability-icon {
        color: #0d72f5;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-capabilities-menu button .mobile-home-capability-icon .fuuvo-linear-svg {
        width: 100%;
        height: 100%;
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-scenes-title {
        order: 3;
        margin: 38px 4px 17px;
        display: block;
        color: #10284c;
        font-size: 18px;
        font-weight: 580;
        line-height: 1.4;
    }

    body.chat-landing[data-mode="chat"] #core-feature-slot {
        order: 4;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        display: block !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-actions {
        width: 100% !important;
        margin: 0 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 122px !important;
        padding: 17px 8px 15px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 14px !important;
        border: 1px solid #d9e1eb !important;
        border-radius: 15px !important;
        background: #fff !important;
        color: #10284c !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        line-height: 1.35 !important;
        box-shadow: none !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .fuuvo-icon {
        width: 45px !important;
        height: 45px !important;
        flex: 0 0 45px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .fuuvo-icon {
        background-color: transparent !important;
        background-image: var(--fuuvo-icon-url) !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        background-size: contain !important;
        -webkit-mask: none !important;
        mask: none !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-disclaimer {
        order: 5;
        margin: 38px 0 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        color: #72819a;
        font-size: 13px;
        line-height: 1.5;
        text-align: center;
    }

    body.chat-landing[data-mode="chat"] .mobile-home-disclaimer a {
        color: #6d82a1;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
    }
}

/* Final mobile homepage header alignment. Keep this at the end so legacy
   landing-page rules cannot restore the taller header or extra actions. */
@media (max-width: 920px) {
    html body.chat-landing[data-mode] .mobile-chat-topbar,
    html body[data-mode] .mobile-chat-topbar {
        height: 64px !important;
        min-height: 64px !important;
        max-height: 64px !important;
        padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)) !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

    html body.chat-landing[data-mode] .mobile-chat-primary-actions,
    html body.chat-landing[data-mode] .mobile-chat-actions {
        height: 100% !important;
        align-items: center !important;
    }

    html body.chat-landing[data-mode] .mobile-nav-trigger {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 9px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    html body.chat-landing[data-mode] .mobile-nav-bars,
    html body.chat-landing[data-mode] .mobile-nav-bars > img {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
    }

    html body.chat-landing[data-mode] .mobile-chat-actions > .mobile-chat-btn {
        display: none !important;
    }
}

@media (max-width: 920px), (hover: none) and (pointer: coarse) and (max-width: 1366px) {
    /* Keep the mobile header functional without spending a row on branding. */
    body[data-mode="chat"] .chat-detail-back-desktop {
        display: none !important;
    }

    body[data-mode="chat"] .chat-detail-back-mobile {
        grid-column: 1 !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border: 0 !important;
        border-radius: 10px !important;
        background: transparent !important;
        color: #10284c !important;
        box-shadow: none !important;
    }

    body[data-mode="chat"] .chat-detail-back-mobile svg {
        width: 27px !important;
        height: 27px !important;
    }

    body.chat-detail-open[data-mode="chat"] .chat-detail-back-mobile:not(.hidden) {
        display: inline-flex !important;
    }

    body.chat-detail-open[data-mode="chat"] .mobile-nav-trigger {
        display: inline-flex !important;
    }

    body.chat-detail-open[data-mode="chat"] #mobile-new-chat-trigger {
        display: none !important;
    }

    body[data-mode="chat"] .mobile-chat-topbar,
    body.chat-landing[data-mode="chat"] .mobile-chat-topbar {
        min-height: 72px !important;
        padding: 0 10px !important;
        grid-template-columns: max-content minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    body[data-mode="chat"] .mobile-chat-bar,
    body.chat-landing[data-mode="chat"] .mobile-chat-bar {
        display: none !important;
    }

    body[data-mode="chat"] .mobile-chat-actions,
    body.chat-landing[data-mode="chat"] .mobile-chat-actions {
        position: relative !important;
        inset: auto !important;
        grid-column: 2 !important;
        justify-self: end !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    body[data-mode="chat"] .mobile-nav-trigger,
    body.chat-landing[data-mode="chat"] .mobile-nav-trigger {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
    }

    body[data-mode="chat"] .mobile-home-scenes-title,
    body[data-mode="chat"] .mobile-home-capabilities,
    body[data-mode="chat"] .mobile-home-disclaimer {
        display: none !important;
    }

    body[data-mode="chat"] .mobile-chat-toolbar {
        left: 56px !important;
        right: auto !important;
        bottom: 7px !important;
        z-index: 7 !important;
        width: auto !important;
        padding: 0 !important;
    }

    body[data-mode="chat"] .mobile-chat-toolbar .mobile-chat-more-menu {
        left: 0 !important;
        width: 220px !important;
        min-width: 220px !important;
        max-width: calc(100vw - 24px) !important;
    }

    body.chat-landing[data-mode="chat"] .composer {
        min-height: calc(100dvh - 122px) !important;
        padding-top: 30px !important;
        padding-bottom: 24px !important;
    }

    body.chat-landing[data-mode="chat"] #chat-compose-field {
        position: relative !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar {
        position: absolute !important;
        left: 68px !important;
        right: auto !important;
        bottom: 19px !important;
        z-index: 12 !important;
        width: auto !important;
        min-height: 38px !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        pointer-events: none !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar-btn,
    body.chat-landing[data-mode="chat"] .mobile-chat-more-menu {
        pointer-events: auto !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-more-menu {
        max-height: min(38vh, 220px) !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar-btn {
        min-height: 36px !important;
        padding: 0 11px !important;
        border: 1px solid #d7e0eb !important;
        border-radius: 999px !important;
        background: #fff !important;
        color: #10284c !important;
        box-shadow: none !important;
        font-size: 12px !important;
    }

    body[data-mode="chat"] .landing-workspace-disclaimer,
    body[data-mode="chat"] .mobile-home-disclaimer {
        display: none !important;
    }

    body[data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer),
    body.chat-landing[data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer) {
        position: static !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 3px 8px max(5px, env(safe-area-inset-bottom)) !important;
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 2px 5px !important;
        color: #98a2b3 !important;
        font-size: 9px !important;
        font-weight: 400 !important;
        line-height: 1.25 !important;
        text-align: center !important;
        white-space: normal !important;
        overflow: visible !important;
    }

    body[data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer) > span {
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
    }

    body[data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer) > a {
        color: #8a96a8 !important;
        font-size: inherit !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    body[data-ui-theme="dark"][data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer) {
        color: #77869d !important;
    }

    body[data-ui-theme="dark"][data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer) > a {
        color: #8494ac !important;
    }
}

/* A resized desktop window still needs desktop density. The mobile shell is
 * used below 921px, but tablet-width windows keep the four primary actions in
 * one compact row instead of inheriting the large two-column phone cards. */
@media (min-width: 601px) and (max-width: 920px), (hover: none) and (pointer: coarse) and (min-width: 601px) and (max-width: 1366px) {
    body.chat-landing[data-mode="chat"] .composer {
        min-height: calc(100dvh - 54px) !important;
        padding: 20px 20px 18px !important;
    }

    body.chat-landing[data-mode="chat"] .composer-top {
        margin-bottom: 14px !important;
    }

    body.chat-landing[data-mode="chat"] .composer-title {
        font-size: 22px !important;
        line-height: 1.25 !important;
        letter-spacing: 0 !important;
    }

    body.chat-landing[data-mode="chat"] .composer-desc {
        margin-top: 6px !important;
        font-size: 13px !important;
        line-height: 1.45 !important;
    }

    body.chat-landing[data-mode="chat"] .composer-desc[hidden] {
        display: none !important;
        margin: 0 !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-wrap,
    body.chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        min-height: 108px !important;
        height: 108px !important;
        border-radius: 16px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        padding: 17px 16px 52px !important;
        font-size: 14px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-hint {
        top: 17px !important;
        left: 16px !important;
        right: 16px !important;
        font-size: 13px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-tools {
        left: 12px !important;
        right: 12px !important;
        bottom: 10px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-tool-btn {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-tool-btn svg {
        width: 19px !important;
        height: 19px !important;
    }

    body.chat-landing[data-mode="chat"] .send-btn {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar {
        left: 58px !important;
        bottom: 10px !important;
    }

    body.chat-landing[data-mode="chat"] #core-feature-slot {
        margin-top: 12px !important;
    }

    body[data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer),
    body.chat-landing[data-mode="chat"] .workspace > .workspace-disclaimer:not(.landing-workspace-disclaimer) {
        position: absolute !important;
        right: 10px !important;
        bottom: 4px !important;
        left: 10px !important;
        width: auto !important;
    }

    body.chat-landing[data-mode="chat"] .workspace > .fuuvo-ai-disclaimer {
        position: static !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 5px 10px max(6px, env(safe-area-inset-bottom)) !important;
        flex: 0 0 auto !important;
        gap: 1px !important;
        font-size: 9px !important;
        line-height: 1.35 !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn {
        min-height: 82px !important;
        padding: 10px 6px !important;
        gap: 7px !important;
        border-radius: 11px !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .fuuvo-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .home-core-feature-icon {
        width: 30px !important;
        height: 30px !important;
        flex: 0 0 30px !important;
    }
}

/* Phone landing page polish. Keep Chinese and English layouts visually
 * consistent while allowing longer English copy to wrap safely. */
@media (max-width: 600px) {
    body.chat-landing[data-mode="chat"] .composer {
        padding: 24px 18px 18px !important;
    }

    body.chat-landing[data-mode="chat"] .composer-top {
        margin-bottom: 20px !important;
    }

    body.chat-landing[data-mode="chat"] .composer-title {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: auto !important;
        margin-left: auto !important;
        font-size: clamp(23px, 6.5vw, 26px) !important;
        line-height: 1.24 !important;
        letter-spacing: -.45px !important;
        white-space: normal !important;
        overflow-wrap: normal !important;
        text-wrap: balance;
    }

    body.chat-landing[data-mode="chat"] .composer-title.has-fuuvo-slogan {
        gap: 6px !important;
        font-size: clamp(16px, 4.5vw, 18px) !important;
        line-height: 1.4 !important;
        letter-spacing: 0 !important;
        flex-wrap: wrap !important;
        white-space: normal !important;
    }

    body.chat-landing[data-mode="chat"] .composer-desc[hidden] {
        display: none !important;
        margin: 0 !important;
    }

    body.chat-landing[data-mode="chat"] .composer-desc:not([hidden]) {
        max-width: 320px !important;
        margin: 8px auto 0 !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-wrap,
    body.chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        min-height: 150px !important;
        height: 150px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        padding: 20px 18px 64px !important;
        font-size: 16px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-hint {
        top: 20px !important;
        right: 18px !important;
        left: 18px !important;
        font-size: 15px !important;
        white-space: normal !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-tools {
        right: 14px !important;
        bottom: 14px !important;
        left: 14px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-tool-btn {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-tool-btn svg {
        width: 21px !important;
        height: 21px !important;
    }

    body.chat-landing[data-mode="chat"] .send-btn {
        width: 46px !important;
        min-width: 46px !important;
        height: 46px !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar {
        left: 64px !important;
        bottom: 17px !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-more-menu {
        border-radius: 16px !important;
        scrollbar-width: thin;
        scrollbar-color: #b9c5d5 transparent;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-more-item {
        min-height: 42px !important;
        gap: 10px !important;
        font-size: 14px !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-more-icon,
    body.chat-landing[data-mode="chat"] .mobile-chat-more-icon svg,
    body.chat-landing[data-mode="chat"] .mobile-chat-more-icon .fuuvo-icon {
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 20px !important;
        color: #0d72f5 !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-more-icon img {
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 20px !important;
        display: block !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        object-fit: contain !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-home-capability-icon,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-home-capabilities-menu button img,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-more-icon img {
        background: transparent !important;
        filter: none !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-actions {
        gap: 10px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn {
        min-height: 100px !important;
        padding: 12px 8px !important;
        gap: 9px !important;
        border-radius: 14px !important;
        font-size: 15px !important;
        line-height: 1.35 !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-favorite-btn {
        padding-right: 26px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .fuuvo-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .home-core-feature-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .home-capability-icon {
        width: 36px !important;
        height: 36px !important;
        flex: 0 0 36px !important;
        max-width: none !important;
        object-fit: contain !important;
    }

    body.chat-landing[data-mode="chat"] .home-favorite-group:last-child .home-favorite-option:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        width: calc(50% - 4px);
        justify-self: center;
    }

    body.chat-landing[data-mode="chat"] .workspace > .fuuvo-ai-disclaimer {
        position: static !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 7px 10px max(7px, env(safe-area-inset-bottom)) !important;
        flex: 0 0 auto !important;
        gap: 2px !important;
        font-size: 10px !important;
        line-height: 1.4 !important;
    }

    body.chat-landing[data-mode="chat"] .fuuvo-ai-disclaimer-product {
        line-height: 1.35 !important;
    }
}

@media (max-width: 350px) {
    body.chat-landing[data-mode="chat"] .composer {
        padding-right: 14px !important;
        padding-left: 14px !important;
    }

    body.chat-landing[data-mode="chat"] .composer-title {
        font-size: 22px !important;
    }

    body.chat-landing[data-mode="chat"] .composer-title.has-fuuvo-slogan {
        font-size: 16px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn {
        min-height: 94px !important;
        font-size: 14px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .fuuvo-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .home-core-feature-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .home-capability-icon {
        width: 34px !important;
        height: 34px !important;
        flex-basis: 34px !important;
    }
}

/* iOS home interaction safety. Restore normal tap handling for the landing
   surface and its controls when the shared narrow-screen rules are active. */
@media (max-width: 920px) {
    html,
    body.chat-landing[data-mode="chat"] {
        touch-action: manipulation !important;
    }

    body.chat-landing[data-mode="chat"] button,
    body.chat-landing[data-mode="chat"] a,
    body.chat-landing[data-mode="chat"] [role="button"],
    body.chat-landing[data-mode="chat"] [role="menuitem"] {
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(37, 120, 232, .14);
    }

    body.chat-landing[data-mode="chat"] .composer,
    body.chat-landing[data-mode="chat"] .mobile-home-capabilities,
    body.chat-landing[data-mode="chat"] .mobile-chat-actions,
    body.chat-landing[data-mode="chat"] .mobile-chat-topbar {
        pointer-events: auto;
    }
}

@media (min-width: 921px) and (hover: hover) and (pointer: fine) {
    .mobile-chat-logo,
    .mobile-home-scenes-title,
    .mobile-home-capabilities,
    .mobile-home-disclaimer {
        display: none !important;
    }
}

/* iOS home interaction safety. The shared narrow-screen layout locks the
   viewport with touch-action:none; keep that only for gesture-specific
   controls and restore normal taps for the home UI. */
@media (max-width: 920px) {
    html,
    body.chat-landing[data-mode="chat"] {
        touch-action:manipulation !important;
    }

    body.chat-landing[data-mode="chat"] button,
    body.chat-landing[data-mode="chat"] a,
    body.chat-landing[data-mode="chat"] [role="button"],
    body.chat-landing[data-mode="chat"] [role="menuitem"] {
        touch-action:manipulation !important;
        -webkit-tap-highlight-color:rgba(37, 120, 232, .14);
    }

    body.chat-landing[data-mode="chat"] .composer,
    body.chat-landing[data-mode="chat"] .mobile-home-capabilities,
    body.chat-landing[data-mode="chat"] .mobile-chat-actions,
    body.chat-landing[data-mode="chat"] .mobile-chat-topbar {
        pointer-events:auto;
    }
}

@media (min-width: 921px) {
    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar {
        display: none !important;
    }
}


/* 2026-07-30: restore the phone landing page to the simple reference layout. */
@media (max-width: 600px) {
    body.chat-landing[data-mode="chat"] .mobile-chat-topbar {
        min-height: 72px !important;
        padding: 0 10px !important;
    }

    body.chat-landing[data-mode="chat"] #mobile-new-chat-trigger {
        display: none !important;
    }

    body.chat-landing[data-mode="chat"] .composer {
        padding: 31px 20px 18px !important;
    }

    body.chat-landing[data-mode="chat"] .composer-top {
        margin-bottom: 23px !important;
    }

    body.chat-landing[data-mode="chat"] .composer-title.has-fuuvo-slogan {
        gap: 6px !important;
        color: #10284c !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-wrap,
    body.chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        min-height: 150px !important;
        height: 150px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        padding: 18px 18px 64px !important;
        font-size: 15px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-hint {
        top: 19px !important;
        left: 18px !important;
        right: 18px !important;
        color: #8290a6 !important;
        font-size: 15px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-input-tools {
        left: 14px !important;
        right: 14px !important;
        bottom: 13px !important;
    }

    body.chat-landing[data-mode="chat"] .chat-tool-btn {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        border-radius: 50% !important;
    }

    body.chat-landing[data-mode="chat"] .chat-tool-btn svg {
        width: 20px !important;
        height: 20px !important;
    }

    body.chat-landing[data-mode="chat"] .send-btn {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar {
        left: 64px !important;
        bottom: 16px !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar-btn {
        min-height: 34px !important;
        padding: 0 12px !important;
        gap: 6px !important;
        border-radius: 999px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
    }

    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar-icon,
    body.chat-landing[data-mode="chat"] .mobile-chat-toolbar-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    body.chat-landing[data-mode="chat"] #core-feature-slot {
        margin-top: 10px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-actions {
        gap: 8px !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn {
        min-height: 78px !important;
        padding: 7px 6px !important;
        gap: 6px !important;
        border-radius: 11px !important;
        font-size: 15px !important;
        font-weight: 500 !important;
    }

    body.chat-landing[data-mode="chat"] .core-feature-btn-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .fuuvo-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .home-core-feature-icon,
    body.chat-landing[data-mode="chat"] .core-feature-btn-icon .home-capability-icon {
        width: 28px !important;
        height: 28px !important;
        flex-basis: 28px !important;
    }
}

@media (max-width: 600px) {
    html:has(body[data-ui-theme="dark"].chat-landing),
    body[data-ui-theme="dark"].chat-landing,
    body[data-ui-theme="dark"].chat-landing .app[data-fuuvo-app-shell="1"],
    body[data-ui-theme="dark"].chat-landing .workspace[data-fuuvo-app-workspace="1"],
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .composer {
        background: #080f1c !important;
        color: #edf2ff !important;
    }

    body[data-ui-theme="dark"].chat-landing .mobile-chat-topbar {
        background: rgba(8, 15, 28, .96) !important;
        border-bottom-color: rgba(148, 163, 184, .12) !important;
    }

    body[data-ui-theme="dark"].chat-landing .mobile-nav-bars,
    body[data-ui-theme="dark"].chat-landing .mobile-chat-actions .ui-language-switch-btn,
    body[data-ui-theme="dark"].chat-landing .mobile-chat-actions .ui-language-switch-btn.active {
        color: #dbe7ff !important;
        -webkit-text-fill-color: #dbe7ff !important;
    }

    body[data-ui-theme="dark"].chat-landing .mobile-chat-actions .ui-language-switch-btn + .ui-language-switch-btn::before {
        background: rgba(148, 163, 184, .24) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .composer-title.has-fuuvo-slogan {
        color: #edf2ff !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap {
        background: #111827 !important;
        border-color: rgba(148, 163, 184, .22) !important;
        box-shadow: 0 12px 26px rgba(2, 6, 23, .34) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap textarea {
        color: #edf2ff !important;
        -webkit-text-fill-color: #edf2ff !important;
        caret-color: #7db5ff !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-hint,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-input-wrap textarea::placeholder {
        color: #8fa0bc !important;
        -webkit-text-fill-color: #8fa0bc !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .chat-tool-btn,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-chat-toolbar-btn {
        background: #0b1220 !important;
        border-color: rgba(148, 163, 184, .24) !important;
        color: #edf2ff !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .send-btn {
        background: #0d72f5 !important;
        color: #fff !important;
        box-shadow: 0 8px 16px rgba(13, 114, 245, .22) !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .core-feature-btn {
        background: #0f172a !important;
        border-color: rgba(148, 163, 184, .18) !important;
        color: #edf2ff !important;
    }

    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .mobile-home-disclaimer,
    body[data-ui-theme="dark"].chat-landing[data-mode="chat"] .workspace > .fuuvo-ai-disclaimer {
        background: #080f1c !important;
        color: #9fb0c8 !important;
    }
}

/* Source: public/static/css/fuuvo-mobile-responsive.css */
/*
 * Shared mobile interaction and layer contract.
 *
 * This stylesheet is loaded after page/theme styles. Every rule is scoped to
 * small viewports so the established desktop layout remains unchanged.
 */

@media (max-width: 920px), (hover: none) and (pointer: coarse) and (max-width: 1366px) {
    :root {
        --fuuvo-mobile-edge: max(12px, env(safe-area-inset-left));
        --fuuvo-mobile-control: 44px;
        --fuuvo-mobile-sheet-z: 320;
    }

    html {
        max-width: 100%;
        overflow-x: hidden;
        touch-action: pan-y !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body {
        max-width: 100%;
        overflow-x: clip;
    }

    /* The legacy creation shell switches to a single column at 900px. Keep
     * the shared 920px mobile breakpoint consistent so 901-920px landscape
     * phones do not leave the workspace trapped in the sidebar grid track. */
    body > .creation-app {
        display: block !important;
        grid-template-columns: none !important;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    :where(main, section, article, aside, form, fieldset, header, footer, nav, div) {
        min-width: 0;
    }

    :where(h1, h2, h3, h4, p, li, label, small, strong, span, a, button) {
        overflow-wrap: break-word;
        word-break: normal;
    }

    /* Compact shared heading scale. Limit page and section headings without
     * enlarging the deliberately small headings used inside tool cards. */
    html body :is(
        .creation-heading,
        .detail-heading,
        .analysis-heading,
        .analysis-home-heading,
        .food-heading,
        .food-results-heading,
        .food-detail-heading,
        .fortune-hero,
        .fortune-result-heading,
        .inspiration-heading,
        .office-heading,
        .office-tool-hero,
        .research-home-heading,
        .research-heading,
        .portal-heading,
        .portal-hero,
        .sr-hero,
        .ss-hero,
        .rr-heading,
        .ac-heading,
        .dc-heading,
        .ai-card-heading,
        .legal-article-hero,
        .community-rules-header,
        .capabilities-content-heading,
        .safety-local-heading,
        .pricing-heading,
        .safety-export-head
    ) h1 {
        font-size: clamp(24px, 7.2vw, 27px) !important;
        line-height: 1.24 !important;
    }

    html body :is(
        .legal-copy section,
        .safety-page-section,
        .community-rule-section,
        .ai-info-section-heading,
        .creation-inspiration,
        .image-form,
        .settings-panel,
        .project-content,
        .brand-panel,
        .team-panel,
        .result-actions,
        .project-ai-brief-card,
        .project-result-brief-card,
        .analysis-spreadsheet-heading,
        .analysis-conclusion,
        .analysis-data-panel,
        .analysis-result-side,
        .fortune-setup,
        .fortune-side-info,
        .fortune-step,
        .fortune-keywords,
        .fortune-continue,
        .fortune-inspiration-side,
        .office-result-content,
        .food-info-panel,
        .food-refine-panel,
        .food-before-panel,
        .food-continue-card,
        .ac-panel,
        .ac-policy-timeline,
        .safety-export-complete
    ) > h2 {
        font-size: clamp(18px, 5.4vw, 20px) !important;
        line-height: 1.32 !important;
    }

    html body :is(
        .legal-copy section,
        .safety-page-section,
        .community-standard-card,
        .creation-visual-card,
        .fortune-setup,
        .fortune-reading-grid,
        .office-result-content,
        .analysis-spreadsheet-preview,
        .safety-choice-panel,
        .ac-export-select
    ) > h3 {
        font-size: clamp(15px, 4.5vw, 17px) !important;
        line-height: 1.4 !important;
    }

    :where(img, video, canvas) {
        max-width: 100%;
    }

    :where(button, [role="button"], input, select, textarea) {
        max-width: 100%;
        font: inherit;
    }

    :where(
        button,
        [role="button"],
        a[class*="-btn"],
        a[class*="-button"],
        .sidebar-nav-btn,
        .outline-link,
        .login-link,
        input[type="button"],
        input[type="submit"],
        input[type="reset"],
        select
    ) {
        min-height: var(--fuuvo-mobile-control);
    }

    :where(
        button,
        [role="button"],
        a[class*="-btn"],
        a[class*="-button"],
        .sidebar-nav-btn,
        .topbar-settings-row,
        .creation-pill,
        .research-outline,
        .outline-link,
        .login-link
    ) {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    :where(
        button,
        [role="button"],
        input[type="button"],
        input[type="submit"],
        input[type="reset"]
    ):not(.auth-mask):not(.topbar-settings-backdrop):not(.image-studio-popover-backdrop):not(.fuuvo-mobile-sidebar-backdrop) {
        min-width: var(--fuuvo-mobile-control);
    }

    :where(button, [role="button"], a, input, select, textarea):focus-visible {
        outline: 2px solid #1677ff;
        outline-offset: 2px;
    }

    :where(input:not([type="checkbox"]):not([type="radio"]), select) {
        min-height: var(--fuuvo-mobile-control);
        font-size: 16px;
    }

    textarea {
        min-height: 96px;
        font-size: 16px;
        resize: vertical;
    }

    /* iOS Safari automatically zooms form controls rendered below 16px.
     * Page-specific styles use stronger selectors, so the shared rule must be
     * important to keep focus from widening, shifting or deforming the page. */
    html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    html body select,
    html body textarea {
        font-size: 16px !important;
    }

    html body .office-app[data-page="index"] .office-start-panel textarea {
        height: 84px !important;
        min-height: 84px !important;
        padding: 10px 13px !important;
        overflow: hidden !important;
        resize: none !important;
        line-height: 1.45 !important;
    }

    html body > [data-fuuvo-app-shell="1"],
    html body [data-fuuvo-app-workspace="1"],
    html body [data-fuuvo-app-scroll="1"] {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    html body [data-fuuvo-app-workspace="1"] {
        overflow-x: clip !important;
    }

    html body[data-mode="chat"] #chat-input {
        min-height: 64px !important;
        max-height: 144px !important;
        resize: none !important;
        overflow-x: hidden !important;
        overflow-y: hidden;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    /* Conversation composer: the tools live on the bottom row, so reserving
     * more than 100px on the right needlessly squeezes both typed text and the
     * hint. Give the editable line the full width and keep a dedicated bottom
     * row for actions. */
    html body[data-mode="chat"]:not(.chat-landing) .chat-input-wrap {
        width: 100% !important;
        min-height: 88px !important;
        height: auto !important;
        overflow: visible !important;
    }

    html body[data-mode="chat"]:not(.chat-landing) .chat-input-wrap textarea,
    html body[data-mode="chat"]:not(.chat-landing) #chat-input {
        width: 100% !important;
        min-height: 88px !important;
        max-height: 168px !important;
        padding: 14px 14px 48px !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
        overflow-x: hidden !important;
        overflow-y: auto;
        scroll-margin: 0 !important;
    }

    html body[data-mode="chat"]:not(.chat-landing) .chat-input-hint {
        top: 14px !important;
        right: 14px !important;
        left: 14px !important;
        width: auto !important;
        height: auto !important;
        max-height: 44px;
        font-size: 14px !important;
        line-height: 1.45 !important;
        white-space: normal !important;
        overflow: hidden !important;
        text-overflow: ellipsis;
    }

    html body[data-mode="chat"]:not(.chat-landing) .chat-input-tools {
        right: 10px !important;
        bottom: 8px !important;
        left: 10px !important;
        width: auto !important;
        justify-content: space-between !important;
    }

    /* Let the visual viewport resize the application naturally. Fixing both
     * html and body while the keyboard opens moves the composer to the top in
     * some Android browsers. */
    html body.mobile-chat-input-focused:not(.chat-landing) .app,
    html body.mobile-chat-input-focused:not(.chat-landing) .workspace {
        width: 100% !important;
        height: var(--mobile-viewport-height, 100dvh) !important;
        min-height: 0 !important;
        max-height: var(--mobile-viewport-height, 100dvh) !important;
        overflow: hidden !important;
    }

    /* The shared account launcher is a fixed mobile portal with a higher
     * global z-index than the chat composer. Once the composer is active, it
     * must stay above that portal so the send action cannot be intercepted by
     * an account card that was opened previously. */
    html body[data-mode="chat"] .composer {
        position: sticky !important;
        z-index: 1501 !important;
    }

    html body[data-mode="chat"].mobile-chat-input-focused [data-fuuvo-account-portal="1"],
    html body[data-mode="chat"].mobile-keyboard-open [data-fuuvo-account-portal="1"] {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    html body.mobile-keyboard-open:not(.chat-landing) .workspace-disclaimer {
        display: none !important;
    }

    html body.mobile-keyboard-open:not(.chat-landing) .composer {
        padding-bottom: max(6px, env(safe-area-inset-bottom)) !important;
    }

    /* Keep the two primary mobile chat actions available on the landing page,
     * while typing, and after the first answer opens the conversation detail. */
    html body[data-mode="chat"] .mobile-chat-topbar {
        display: grid !important;
        flex: 0 0 auto !important;
    }

    html body[data-mode="chat"] .mobile-chat-primary-actions {
        display: inline-flex;
        align-items: center;
        align-self: center;
        justify-self: start;
        gap: 2px;
        min-width: 0;
        position: relative;
        z-index: 34;
    }

    html body[data-mode="chat"] .mobile-chat-primary-actions .mobile-nav-trigger,
    html body[data-mode="chat"] .mobile-new-chat-trigger {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: var(--fuuvo-mobile-control) !important;
        min-width: var(--fuuvo-mobile-control) !important;
        height: var(--fuuvo-mobile-control) !important;
        min-height: var(--fuuvo-mobile-control) !important;
        padding: 0 !important;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #475569;
        box-shadow: none;
        overflow: visible !important;
    }

    html body[data-mode="chat"] .mobile-chat-primary-actions .mobile-nav-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--fuuvo-mobile-control);
        min-width: var(--fuuvo-mobile-control);
        height: var(--fuuvo-mobile-control);
        min-height: var(--fuuvo-mobile-control);
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    html body[data-mode="chat"] .mobile-chat-primary-actions .mobile-nav-bars,
    html body[data-mode="chat"] .mobile-new-chat-trigger svg {
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
    }

    html body[data-mode="chat"] .mobile-chat-primary-actions .mobile-nav-title {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    html body[data-mode="chat"] .mobile-chat-primary-actions :is(.mobile-nav-trigger, .mobile-new-chat-trigger):active {
        background: rgba(148, 163, 184, .14);
    }

    html body[data-ui-theme="dark"][data-mode="chat"] .mobile-chat-primary-actions :is(.mobile-nav-trigger, .mobile-new-chat-trigger) {
        color: #cbd5e1;
    }

    /* The landing surface intentionally keeps a light header even when the
     * saved theme is dark, so its new-chat glyph must use the light-header
     * foreground instead of the detail view's pale foreground. */
    html body.chat-landing[data-ui-theme="dark"][data-mode="chat"] .mobile-new-chat-trigger {
        color: #121826;
    }

    .chat-conversation-loading,
    .conversation-load-error {
        width: min(100%, 760px);
        min-height: 220px;
        margin: 0 auto;
        padding: 24px max(14px, env(safe-area-inset-right)) 30px max(14px, env(safe-area-inset-left));
    }

    .chat-conversation-loading {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .chat-conversation-loading-copy {
        color: #64748b;
        font-size: 13px;
        line-height: 1.45;
    }

    .chat-conversation-loading-bubble {
        width: 68%;
        height: 74px;
        border-radius: 20px;
        background: linear-gradient(100deg, rgba(148, 163, 184, .12) 8%, rgba(148, 163, 184, .24) 18%, rgba(148, 163, 184, .12) 33%);
        background-size: 220% 100%;
        animation: fuuvo-mobile-skeleton 1.35s linear infinite;
    }

    .chat-conversation-loading-bubble.is-wide {
        width: 88%;
        height: 104px;
    }

    .chat-conversation-loading-bubble.is-user {
        width: 48%;
        height: 62px;
        align-self: flex-end;
    }

    .conversation-load-error {
        display: grid;
        place-content: center;
        justify-items: center;
        gap: 14px;
        color: #475569;
        text-align: center;
    }

    .conversation-load-error p {
        margin: 0;
        line-height: 1.6;
    }

    .conversation-load-error button {
        min-width: 112px !important;
        padding: 0 18px;
        border: 0;
        border-radius: 999px;
        background: #1677ff;
        color: #fff;
        font-weight: 700;
    }

    @keyframes fuuvo-mobile-skeleton {
        to {
            background-position-x: -220%;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .chat-conversation-loading-bubble {
            animation: none;
        }
    }

    body[data-ui-theme="dark"] .chat-conversation-loading-copy,
    body[data-ui-theme="dark"] .conversation-load-error {
        color: #cbd5e1;
    }

    body[data-ui-theme="dark"] .chat-conversation-loading-bubble {
        background: linear-gradient(100deg, rgba(71, 85, 105, .24) 8%, rgba(100, 116, 139, .38) 18%, rgba(71, 85, 105, .24) 33%);
        background-size: 220% 100%;
    }

    /* Keep safety, account, and quick settings reachable in the mobile drawer. */
    aside[data-fuuvo-shared-sidebar="1"] .fuuvo-mobile-sidebar-auth {
        display: none !important;
    }

    aside[data-fuuvo-shared-sidebar="1"] .sidebar-safety-link {
        min-height: 44px !important;
        padding: 0 10px !important;
        display: flex !important;
        align-items: center;
        flex: 0 0 auto !important;
    }

    aside[data-fuuvo-shared-sidebar="1"] .sidebar-account-area {
        display: block !important;
        margin-top: 0 !important;
        padding: 6px 4px calc(8px + env(safe-area-inset-bottom)) !important;
        border-top: 1px solid rgba(148, 163, 184, .24);
    }

    aside[data-fuuvo-shared-sidebar="1"] .sidebar-account-card {
        min-height: 48px;
    }

    aside[data-fuuvo-shared-sidebar="1"] .sidebar-account-toggle {
        min-height: 48px;
    }

    aside[data-fuuvo-shared-sidebar="1"] .sidebar-quick-settings {
        box-sizing: border-box;
        left: 0 !important;
        right: 0 !important;
        bottom: calc(62px + env(safe-area-inset-bottom));
        width: auto !important;
        max-width: 100% !important;
        max-height: min(520px, calc(100dvh - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* Shared topbar controls: 44px touch targets without enlarging artwork. */
    :where(
        .desktop-history-toggle,
        .creation-sidebar-toggle,
        .portal-sidebar-toggle,
        .mobile-nav-trigger,
        .fuuvo-mobile-sidebar-close,
        .workspace-header-link,
        .desktop-action-icon,
        .password-toggle,
        .modal-close,
        .legal-close,
        .conversation-search-close,
        .topbar-settings-drawer-head button
    ) {
        width: var(--fuuvo-mobile-control) !important;
        min-width: var(--fuuvo-mobile-control) !important;
        height: var(--fuuvo-mobile-control) !important;
        min-height: var(--fuuvo-mobile-control) !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* The shared touch target is 44px tall on mobile, the same as the
     * settings password input. Align the whole target with the input so its
     * focus background and eye icon stay vertically centered. */
    .settings-dialog .auth-field.password-field > .password-toggle {
        bottom: 0;
        margin: 0;
        padding: 0;
        line-height: 0;
    }

    .settings-dialog .auth-field.password-field > .password-toggle svg {
        display: block;
        margin: auto;
    }

    /* Chat styles use higher-specificity !important widths; reassert the
     * touch target contract explicitly for the shared mobile header. */
    body .mobile-nav-trigger,
    body .desktop-history-toggle,
    body .creation-sidebar-toggle,
    body .portal-sidebar-toggle,
    body .fuuvo-mobile-sidebar-close,
    body .workspace-header-link,
    body .desktop-action-icon,
    body .chat-tool-btn {
        width: var(--fuuvo-mobile-control) !important;
        min-width: var(--fuuvo-mobile-control) !important;
        height: var(--fuuvo-mobile-control) !important;
        min-height: var(--fuuvo-mobile-control) !important;
    }

    body .mobile-chat-toolbar-btn {
        min-height: var(--fuuvo-mobile-control) !important;
    }

    body aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn {
        height: auto !important;
        min-height: var(--fuuvo-mobile-control) !important;
        padding: 0 14px !important;
        justify-content: flex-start !important;
        border: 0 !important;
        border-radius: 8px !important;
        background: transparent !important;
        color: #2f2f2f !important;
        font-size: 14px !important;
        font-weight: 400 !important;
    }

    html body[data-mode] aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn {
        height: auto !important;
        min-height: var(--fuuvo-mobile-control) !important;
    }

    body aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn .rail-icon,
    body aside[data-fuuvo-shared-sidebar="1"] :is(#sidebar-new-chat, .portal-new-chat) .rail-icon {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 15px !important;
    }

    body aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn .rail-glyph,
    body aside[data-fuuvo-shared-sidebar="1"] :is(#sidebar-new-chat, .portal-new-chat) .rail-glyph {
        width: 25px !important;
        height: 25px !important;
        flex: 0 0 25px !important;
        display: grid !important;
        place-items: center !important;
        transform-origin: center !important;
    }

    body aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn picture.rail-glyph > img {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        object-fit: contain !important;
        object-position: center !important;
    }


    html body aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav .sidebar-nav-btn .rail-text {
        color: inherit !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 20px !important;
    }

    body aside[data-fuuvo-shared-sidebar="1"] :is(#sidebar-new-chat, .portal-new-chat) {
        width: 100% !important;
        min-height: var(--fuuvo-mobile-control) !important;
        margin: 0 !important;
        padding: 0 14px !important;
        justify-content: flex-start !important;
        border: 0 !important;
        border-radius: 10px !important;
        background: transparent !important;
        color: #2f2f2f !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        box-shadow: none !important;
    }

    body aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn:hover,
    body aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn.active,
    body aside[data-fuuvo-shared-sidebar="1"] :is(#sidebar-new-chat, .portal-new-chat):hover {
        background: #f3f3f3 !important;
        color: #2f2f2f !important;
        box-shadow: none !important;
    }

    body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn,
    body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(#sidebar-new-chat, .portal-new-chat) {
        border-color: transparent !important;
        background: transparent !important;
        color: #ececec !important;
    }

    body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn:hover,
    body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav-btn.active,
    body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] :is(#sidebar-new-chat, .portal-new-chat):hover {
        background: rgba(255, 255, 255, .09) !important;
        color: #f5f5f5 !important;
    }

    html body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav .sidebar-nav-btn.active {
        background: rgba(255, 255, 255, .09) !important;
        color: #f5f5f5 !important;
        box-shadow: none !important;
    }

    html body[data-ui-theme="dark"] aside[data-fuuvo-shared-sidebar="1"] .sidebar-nav :is(#sidebar-new-chat.sidebar-nav-btn.active, .portal-new-chat.active) {
        border-color: transparent !important;
        background: transparent !important;
        color: #ececec !important;
        box-shadow: none !important;
    }

    html body[data-mode] .mobile-nav-trigger,
    html body[data-mode] .ui-language-switch-btn,
    html body[data-mode] .chat-tool-btn,
    html body[data-mode] .mobile-chat-toolbar-btn,
    html body.chat-landing[data-mode] .mobile-nav-trigger,
    html body.chat-landing[data-mode] .ui-language-switch-btn,
    html body.chat-landing[data-mode] .chat-tool-btn,
    html body.chat-landing[data-mode] .mobile-chat-toolbar-btn {
        min-width: var(--fuuvo-mobile-control) !important;
        min-height: var(--fuuvo-mobile-control) !important;
    }

    html body[data-mode] .mobile-nav-trigger,
    html body[data-mode] .ui-language-switch-btn,
    html body[data-mode] .chat-tool-btn,
    html body.chat-landing[data-mode] .mobile-nav-trigger,
    html body.chat-landing[data-mode] .ui-language-switch-btn,
    html body.chat-landing[data-mode] .chat-tool-btn {
        width: var(--fuuvo-mobile-control) !important;
        height: var(--fuuvo-mobile-control) !important;
    }

    body .composer-title-logo-link {
        min-width: var(--fuuvo-mobile-control) !important;
        min-height: var(--fuuvo-mobile-control) !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    :where(.creation-language, .portal-language, .ui-language-switch, .auth-language-switch) a,
    :where(.creation-language, .portal-language, .ui-language-switch) button {
        min-width: var(--fuuvo-mobile-control) !important;
        min-height: var(--fuuvo-mobile-control) !important;
        padding-inline: 9px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body .creation-language a,
    body .portal-language a,
    body .ui-language-switch-btn,
    body .auth-language-switch a {
        min-width: var(--fuuvo-mobile-control) !important;
        min-height: var(--fuuvo-mobile-control) !important;
    }

    .workspace-chat-header,
    .creation-topbar,
    .portal-topbar {
        min-height: 64px;
        padding-left: max(10px, env(safe-area-inset-left)) !important;
        padding-right: max(10px, env(safe-area-inset-right)) !important;
    }

    /* Sticky mobile headers must fully cover the scrolling content beneath
     * them. A solid surface also avoids text ghosting on iOS Safari. */
    html body > :is(.creation-app, .portal-shell, .feature-shell) header[data-fuuvo-shared-topbar="1"],
    html body[data-mode] .workspace-chat-header,
    html body .mobile-chat-topbar {
        z-index: 90 !important;
        border-bottom: 1px solid #e7ebf1 !important;
        background: #ffffff !important;
        background-image: none !important;
        box-shadow: 0 2px 8px rgba(15, 23, 42, .06) !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        isolation: isolate;
    }

    html body[data-ui-theme="dark"] > :is(.creation-app, .portal-shell, .feature-shell) header[data-fuuvo-shared-topbar="1"],
    html body[data-ui-theme="dark"][data-mode] .workspace-chat-header,
    html body[data-ui-theme="dark"] .mobile-chat-topbar {
        border-bottom-color: #2d3746 !important;
        background: #101722 !important;
        background-image: none !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .24) !important;
    }

    .shell-topbar-left,
    .shell-topbar-center,
    .shell-topbar-right {
        min-width: 0;
    }

    .shell-topbar-left { gap: 2px; }

    .shell-history-back {
        min-width: 58px;
        min-height: var(--fuuvo-mobile-control);
        padding: 0 5px 0 2px;
        gap: 1px;
        font-size: 13px;
    }

    .shell-history-back svg {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }

    .shell-topbar-center strong,
    .creation-topbar-title,
    .portal-topbar-title {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .shell-topbar-back,
    .shell-topbar-middle {
        min-height: var(--fuuvo-mobile-control);
        min-width: 0;
        display: inline-flex;
        align-items: center;
    }

    .shell-topbar-back span,
    .shell-topbar-middle {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body > :where(.creation-app, .portal-shell, .feature-shell) [data-fuuvo-app-scroll="1"] {
        padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important;
    }

    /* Button groups may wrap instead of squeezing labels or icons. */
    :where(
        .creation-pills,
        .result-bottom-actions,
        .auth-dialog-actions,
        .outline-actions,
        .learning-result-actions,
        .project-result-actions,
        .food-detail-actions
    ) {
        flex-wrap: wrap;
        gap: 10px;
    }

    :where(.creation-pill, .result-bottom-actions button, .result-bottom-actions a) {
        min-height: var(--fuuvo-mobile-control) !important;
        white-space: normal;
        line-height: 1.35;
        text-align: center;
    }

    /* Dialogs and modal layers stay inside the visual viewport. */
    :where(
        .auth-overlay,
        .settings-overlay,
        .user-settings-overlay,
        .legal-doc-overlay,
        .legal-overlay,
        .modal-backdrop
    ) {
        padding:
            max(12px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            max(12px, env(safe-area-inset-bottom))
            max(12px, env(safe-area-inset-left)) !important;
        overscroll-behavior: none;
    }

    :where(.auth-dialog, .settings-dialog, .legal-doc-dialog, .legal-dialog, .modal) {
        width: min(680px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))) !important;
        max-width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
        max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        margin: 0 !important;
        overscroll-behavior: contain;
    }

    :where(.auth-dialog, .modal) {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    :where(.settings-dialog, .legal-doc-dialog, .legal-dialog) {
        overflow: hidden !important;
    }

    :where(.legal-content, .legal-doc-content, .settings-main, .settings-content, .modal-content) {
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* Keep all settings tabs inside the mobile dialog. The close control only
       reserves space beside the title; the navigation receives the full row. */
    .settings-dialog .settings-sidebar {
        padding: 18px 18px 12px !important;
        overflow: visible !important;
    }

    .settings-dialog .settings-sidebar h3 {
        padding-right: 48px;
    }

    .settings-dialog .settings-nav {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px !important;
        overflow: visible !important;
    }

    .settings-dialog .settings-nav-btn {
        width: 100%;
        min-width: 0;
        min-height: 46px !important;
        padding: 6px 5px !important;
        justify-content: center;
        text-align: center;
        white-space: normal !important;
        line-height: 1.25;
    }

    .settings-dialog .settings-nav-btn > span {
        min-width: 0;
        max-width: 100%;
    }

    :where(.auth-dialog-head, .modal-head, .legal-head, .settings-header) {
        min-width: 0;
        gap: 10px;
    }

    :where(.auth-dialog-head h3, .modal-head h2, .legal-head h3, .settings-header h2) {
        min-width: 0;
        font-size: clamp(20px, 6vw, 26px) !important;
    }

    /* Open layers lock the document; their own content remains scrollable. */
    body:has(.auth-overlay:not(.hidden)),
    body:has(.settings-overlay:not(.hidden)),
    body:has(.user-settings-overlay:not(.hidden)),
    body:has(.legal-doc-overlay:not(.hidden)),
    body:has(.legal-overlay.active),
    body:has(.modal-backdrop.open),
    body:has(.topbar-settings-drawer:not(.hidden)),
    body:has(.image-studio-popover.is-mobile-sheet:not(.hidden)) {
        height: 100dvh !important;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body.mobile-nav-open,
    body.fuuvo-mobile-sidebar-open,
    body.fuuvo-mobile-tools-open {
        height: 100dvh !important;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body.mobile-nav-open,
    body.fuuvo-mobile-sidebar-open {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }

    body.fuuvo-mobile-tools-open {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }

    .fuuvo-mobile-tool-sheet-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: calc(var(--fuuvo-mobile-sheet-z) - 1);
        width: 100%;
        min-width: 0 !important;
        height: 100%;
        min-height: 0 !important;
        padding: 0;
        border: 0;
        background: rgba(8, 15, 28, .54);
        backdrop-filter: blur(3px);
        touch-action: none;
    }

    body.fuuvo-mobile-tools-open .fuuvo-mobile-tool-sheet-backdrop:not(.hidden) {
        display: block;
    }

    html body #mobile-chat-more-menu,
    html body #mobile-home-capabilities-menu {
        position: fixed !important;
        left: max(10px, env(safe-area-inset-left)) !important;
        right: max(10px, env(safe-area-inset-right)) !important;
        top: auto !important;
        bottom: 0 !important;
        z-index: var(--fuuvo-mobile-sheet-z) !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        max-height: min(72dvh, 620px) !important;
        margin: 0 !important;
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom)) !important;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        border: 1px solid rgba(148, 163, 184, .26) !important;
        border-bottom: 0 !important;
        border-radius: 22px 22px 0 0 !important;
        background: #fff !important;
        box-shadow: 0 -18px 48px rgba(15, 23, 42, .22) !important;
        transform: none !important;
        -webkit-overflow-scrolling: touch;
    }

    html body #mobile-chat-more-menu.hidden,
    html body #mobile-home-capabilities-menu.hidden {
        display: none !important;
    }

    .fuuvo-mobile-tool-sheet-head {
        position: sticky;
        top: 0;
        z-index: 2;
        grid-column: 1 / -1;
        min-height: 62px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 0 -2px;
        padding: 10px 0 8px;
        background: inherit;
    }

    .fuuvo-mobile-tool-sheet-head strong {
        min-width: 0;
        color: #172033;
        font-size: 18px;
        line-height: 1.25;
    }

    body .fuuvo-mobile-tool-sheet-close {
        width: var(--fuuvo-mobile-control) !important;
        min-width: var(--fuuvo-mobile-control) !important;
        height: var(--fuuvo-mobile-control) !important;
        min-height: var(--fuuvo-mobile-control) !important;
        padding: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f1f5f9 !important;
        color: #334155 !important;
    }

    .fuuvo-mobile-tool-sheet-close svg {
        width: 21px;
        height: 21px;
    }

    html body #mobile-chat-more-menu > button:not(.fuuvo-mobile-tool-sheet-close),
    html body #mobile-home-capabilities-menu > button:not(.fuuvo-mobile-tool-sheet-close) {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 62px !important;
        margin: 0 !important;
        padding: 10px 12px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 10px;
        border: 1px solid #e2e8f0 !important;
        border-radius: 14px !important;
        background: #f8fafc !important;
        color: #1e293b !important;
        font-size: 14px !important;
        font-weight: 650 !important;
        line-height: 1.3 !important;
        text-align: center;
        white-space: normal;
    }

    html body #mobile-chat-more-menu .mobile-chat-more-icon,
    html body #mobile-home-capabilities-menu button > img {
        width: 30px !important;
        min-width: 30px !important;
        height: 30px !important;
        flex: 0 0 30px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: inherit;
        overflow: visible;
    }

    html body #mobile-chat-more-menu .mobile-chat-more-icon img,
    html body #mobile-home-capabilities-menu button > img {
        width: 30px !important;
        max-width: 30px !important;
        height: 30px !important;
        max-height: 30px !important;
        flex: 0 0 30px !important;
        display: block !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        object-fit: contain !important;
        filter: none !important;
    }

    html body #mobile-chat-more-menu .mobile-chat-more-icon .fuuvo-icon {
        display: none !important;
    }

    html body #mobile-home-capabilities-menu button > .mobile-home-capability-icon {
        width: 30px !important;
        max-width: 30px !important;
        height: 30px !important;
        max-height: 30px !important;
        flex: 0 0 30px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin-right: 0 !important;
        color: currentColor;
    }

    html body #mobile-home-capabilities-menu button > .mobile-home-capability-icon .fuuvo-linear-svg {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        fill: none !important;
        stroke: currentColor !important;
        stroke-width: 1.5 !important;
        stroke-linecap: round !important;
        stroke-linejoin: round !important;
    }

    html body #mobile-chat-more-menu > button:active,
    html body #mobile-home-capabilities-menu > button:active {
        transform: scale(.98);
        background: #eef4ff !important;
    }

    html body[data-ui-theme="dark"] #mobile-chat-more-menu,
    html body[data-ui-theme="dark"] #mobile-home-capabilities-menu {
        border-color: rgba(148, 163, 184, .22) !important;
        background: #111927 !important;
        box-shadow: 0 -18px 48px rgba(0, 0, 0, .42) !important;
    }

    body[data-ui-theme="dark"] .fuuvo-mobile-tool-sheet-head strong {
        color: #f8fafc;
    }

    body[data-ui-theme="dark"] .fuuvo-mobile-tool-sheet-close {
        background: #202b3d !important;
        color: #e2e8f0 !important;
    }

    html body[data-ui-theme="dark"] #mobile-chat-more-menu > button:not(.fuuvo-mobile-tool-sheet-close),
    html body[data-ui-theme="dark"] #mobile-home-capabilities-menu > button:not(.fuuvo-mobile-tool-sheet-close) {
        border-color: rgba(148, 163, 184, .2) !important;
        background: #172131 !important;
        color: #f1f5f9 !important;
    }

    html body[data-ui-theme="dark"] #mobile-chat-more-menu > button:not(.fuuvo-mobile-tool-sheet-close) > span,
    html body[data-ui-theme="dark"] #mobile-home-capabilities-menu > button:not(.fuuvo-mobile-tool-sheet-close) > span {
        color: #fff !important;
        opacity: 1 !important;
        -webkit-text-fill-color: #fff !important;
    }

    html body[data-ui-theme="dark"] #mobile-chat-more-menu .mobile-chat-more-icon,
    html body[data-ui-theme="dark"] #mobile-chat-more-menu .mobile-chat-more-icon img,
    html body[data-ui-theme="dark"] #mobile-home-capabilities-menu button > img {
        background: transparent !important;
        filter: none !important;
    }

    /* On the landing page the input-toolbar More menu is a contextual popover.
       Conversation-detail pages intentionally retain the full-width sheet. */
    html body.chat-landing[data-mode="chat"] #mobile-chat-more-menu {
        position: absolute !important;
        top: auto !important;
        right: auto !important;
        bottom: calc(100% + 10px) !important;
        left: -68px !important;
        z-index: calc(var(--fuuvo-mobile-sheet-z) + 1) !important;
        width: min(320px, calc(100vw - 40px)) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
        max-height: min(46dvh, 220px) !important;
        margin: 0 !important;
        padding: 8px !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        border: 1px solid #d9e1ec !important;
        border-radius: 16px !important;
        background: #fff !important;
        box-shadow: 0 16px 38px rgba(22, 43, 72, .2) !important;
        transform: none !important;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #b9c5d5 transparent;
        -webkit-overflow-scrolling: touch;
    }

    html body.chat-landing[data-mode="chat"] #mobile-chat-more-menu.hidden {
        display: none !important;
    }

    html body.chat-landing[data-mode="chat"] #mobile-chat-more-menu > button:not(.fuuvo-mobile-tool-sheet-close) {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 7px 9px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        border: 0 !important;
        border-radius: 10px !important;
        background: transparent !important;
        color: #253858 !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        line-height: 1.25 !important;
        text-align: left !important;
        white-space: normal !important;
    }

    html body.chat-landing[data-mode="chat"] #mobile-chat-more-menu .mobile-chat-more-icon,
    html body.chat-landing[data-mode="chat"] #mobile-chat-more-menu .mobile-chat-more-icon img {
        width: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        height: 24px !important;
        max-height: 24px !important;
        flex: 0 0 24px !important;
    }

    html body.chat-landing[data-mode="chat"] #mobile-chat-more-menu > button:active {
        background: #eef4ff !important;
    }

    html body[data-ui-theme="dark"].chat-landing[data-mode="chat"] #mobile-chat-more-menu {
        border-color: rgba(148, 163, 184, .24) !important;
        background: #111927 !important;
        box-shadow: 0 16px 38px rgba(0, 0, 0, .42) !important;
    }

    html body[data-ui-theme="dark"].chat-landing[data-mode="chat"] #mobile-chat-more-menu > button:not(.fuuvo-mobile-tool-sheet-close) {
        background: transparent !important;
        color: #f1f5f9 !important;
    }

    html body[data-ui-theme="dark"].chat-landing[data-mode="chat"] #mobile-chat-more-menu > button:not(.fuuvo-mobile-tool-sheet-close) > span {
        color: #fff !important;
        opacity: 1 !important;
        -webkit-text-fill-color: #fff !important;
    }

    html body[data-ui-theme="dark"].chat-landing[data-mode="chat"] #mobile-chat-more-menu > button:active {
        background: #202b3d !important;
    }

    @media (max-width: 360px) {
        html body.chat-landing[data-mode="chat"] #mobile-chat-more-menu {
            left: -58px !important;
        }
    }

    /* The legal footer belongs to the document, not to the mobile keyboard
       dock. Hide it only while the chat field is active so the home and
       conversation composers can resize without lifting the footer. */
    html body[data-mode="chat"].mobile-chat-input-focused .workspace > .fuuvo-ai-disclaimer,
    html body[data-mode="chat"].mobile-keyboard-open .workspace > .fuuvo-ai-disclaimer,
    html body[data-mode="chat"].mobile-chat-input-focused .workspace > .workspace-disclaimer,
    html body[data-mode="chat"].mobile-keyboard-open .workspace > .workspace-disclaimer {
        display: none !important;
    }

    /* Drawers, dropdowns and popovers receive safe edges and internal scroll. */
    .topbar-settings-backdrop {
        inset: 64px 0 0 !important;
        background: rgba(15, 23, 42, .22) !important;
        backdrop-filter: blur(2px);
    }

    .topbar-settings-drawer {
        top: 64px !important;
        right: env(safe-area-inset-right) !important;
        bottom: 0 !important;
        width: min(360px, calc(100vw - 12px - env(safe-area-inset-left) - env(safe-area-inset-right))) !important;
        max-width: calc(100vw - 12px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
        border-radius: 18px 0 0 0;
        overscroll-behavior: contain;
    }

    .topbar-settings-drawer-body {
        padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .conversation-search-dialog {
        width: min(368px, calc(100vw - 12px - env(safe-area-inset-right))) !important;
        max-width: calc(100vw - 12px - env(safe-area-inset-right)) !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
    }

    :where(
        .chat-upload-popover,
        .image-studio-popover,
        .chat-capability-target-menu,
        .mobile-chat-more-menu,
        .mobile-home-capabilities-menu,
        .workspace-account-dropdown,
        .conversation-menu,
        .food-filter-menu
    ) {
        max-width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
        max-height: calc(100dvh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .chat-upload-popover {
        left: max(12px, env(safe-area-inset-left)) !important;
        right: max(12px, env(safe-area-inset-right)) !important;
        width: auto !important;
    }

    .image-studio-popover.is-mobile-sheet {
        left: max(10px, env(safe-area-inset-left)) !important;
        right: max(10px, env(safe-area-inset-right)) !important;
        bottom: max(10px, env(safe-area-inset-bottom)) !important;
        width: auto !important;
    }

    .conversation-menu.conversation-menu-floating {
        left: auto !important;
        right: max(12px, env(safe-area-inset-right)) !important;
    }

    .food-filter-menu {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }

    :where(
        .mobile-home-capabilities-menu button,
        .mobile-chat-more-menu button,
        .conversation-menu-item,
        .food-filter-option,
        .topbar-settings-row,
        .topbar-settings-option,
        .topbar-settings-panel-back,
        .workspace-account-action
    ) {
        min-height: var(--fuuvo-mobile-control) !important;
    }

    /* Page-specific compact grids: 2 columns on phones, more on wide phones. */
    .creation-category-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    .creation-category-tabs a {
        width: auto !important;
        min-width: 0 !important;
        min-height: 70px !important;
        padding: 7px 6px !important;
        flex: none !important;
        flex-direction: column !important;
        justify-content: center;
        gap: 5px !important;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }

    .creation-category-tabs > a > img,
    .creation-category-tabs svg {
        width: 23px !important;
        height: 23px !important;
        flex-basis: 23px !important;
    }

    .creation-app-entry,
    .voice-card,
    .writing-card {
        min-height: 150px !important;
        padding: 10px 6px !important;
    }

    .creation-app-entry-art,
    .voice-card-icon,
    .writing-card-art {
        width: 76px !important;
        height: 76px !important;
        flex-basis: 76px !important;
    }

    body[data-ui-theme="dark"] :where(.creation-app-entry-art, .voice-card-icon, .writing-card-art) {
        filter: brightness(0) invert(1);
        opacity: .9;
    }

    /* Search & research: show the complete capability range without a six-card long scroll. */
    .research-app .research-home-heading h1 {
        font-size: clamp(27px, 8vw, 31px);
    }

    .research-app .research-home-heading p {
        margin-top: 8px;
        font-size: 13px;
        line-height: 1.45;
    }

    .research-app .research-tabs {
        min-width: 0;
        margin-top: 18px;
        gap: 14px;
    }

    .research-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 18px;
    }

    .research-tool-card {
        min-height: 166px;
        padding: 12px 9px 11px;
        justify-content: flex-start;
        border-radius: 14px;
    }

    .research-tool-card:active {
        transform: scale(.985);
    }

    .research-tool-art {
        width: 100%;
        height: 72px;
        object-fit: contain;
    }

    .research-tool-card h2 {
        margin: 9px 0 4px;
        font-size: 16px;
        line-height: 1.28;
    }

    .research-tool-card p {
        display: -webkit-box;
        margin: 0;
        overflow: hidden;
        font-size: 12.5px;
        line-height: 1.38;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    /* Upload analysis: touch-first wording, compact upload, and primary action before presets. */
    .analysis-upload-desktop-copy {
        display: none;
    }

    .analysis-upload-mobile-copy {
        display: block;
    }

    .analysis-home-layout {
        gap: 16px;
        margin-top: 18px;
    }

    .analysis-home-main {
        display: grid;
    }

    .analysis-upload-drop {
        order: 1;
        min-height: 158px;
        padding: 14px 12px;
        text-align: center;
    }

    .analysis-upload-drop img {
        width: 58px;
        height: 58px;
    }

    .analysis-upload-drop strong {
        margin-top: 10px;
        font-size: 16px;
    }

    .analysis-upload-drop > span {
        margin-top: 5px;
        font-size: 12px;
        line-height: 1.4;
    }

    .analysis-selected-files {
        order: 2;
    }

    .analysis-drop-notes {
        order: 3;
        min-height: 52px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 8px 0;
    }

    .analysis-drop-notes span {
        gap: 6px;
        font-size: 12px;
        line-height: 1.35;
        text-align: center;
    }

    .analysis-drop-notes i {
        display: none;
    }

    .analysis-drop-notes .analysis-icon {
        width: 19px;
        height: 19px;
        flex: 0 0 19px;
    }

    .analysis-form-block {
        display: contents;
    }

    .analysis-prompt-title {
        order: 4;
        margin: 14px 0 9px;
        font-size: 14px;
    }

    .analysis-prompt {
        order: 5;
        min-height: 94px;
        padding: 12px 13px;
        font-size: 16px;
        resize: none;
    }

    .analysis-home-footer {
        order: 6;
        min-height: 0;
        margin-top: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .analysis-start-wrap {
        order: 1;
        width: 100%;
    }

    .analysis-rights {
        order: 2;
        justify-content: center;
        font-size: 12px;
        text-align: center;
    }

    .analysis-primary {
        min-height: 52px;
        font-size: 16px;
    }

    .analysis-quick-pills {
        order: 7;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 4px;
    }

    .analysis-quick-pills button {
        width: 100%;
        min-width: 0 !important;
        min-height: 44px;
        padding: 7px 9px;
        justify-content: flex-start;
        font-size: 12.5px;
        line-height: 1.3;
        text-align: left;
    }

    .analysis-process-panel {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 0 10px 12px;
    }

    .analysis-process-panel > h2,
    .analysis-deeper {
        grid-column: 1 / -1;
    }

    .analysis-process-panel > h2 {
        padding: 16px 4px 8px;
        font-size: 16px;
    }

    .analysis-process-panel article {
        min-height: 142px;
        margin: 0;
        padding: 12px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 7px;
        text-align: center;
    }

    .analysis-process-panel article > .analysis-icon {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }

    .analysis-process-panel article div {
        display: block;
    }

    .analysis-process-panel h3 {
        margin: 0;
        font-size: 13px;
    }

    .analysis-process-panel article strong {
        display: -webkit-box;
        margin-top: 5px;
        overflow: hidden;
        font-size: 11px;
        line-height: 1.35;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .analysis-deeper {
        padding: 12px 4px 2px;
        text-align: center;
    }

    /* Local food: compact address selection, responsive option grids, and an early primary action. */
    .food-app[data-page="home"] .food-main {
        width: calc(100% - 24px);
        padding-top: 20px;
        display: flex;
        flex-direction: column;
    }

    .food-app[data-page="home"] .food-heading {
        order: 1;
    }

    .food-app[data-page="home"] .food-location-panel {
        order: 2;
        width: 100%;
        max-width: 100%;
        align-self: stretch;
        margin-top: 18px;
        padding: 14px;
        border-radius: 14px;
    }

    .food-location-panel h2 {
        margin-bottom: 12px;
        font-size: 17px;
    }

    .food-location-panel h2 img {
        width: 24px;
        height: 24px;
    }

    .food-location-controls {
        gap: 6px;
    }

    .food-location-current {
        min-height: 46px;
        font-size: 15px;
    }

    .food-location-current img {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .food-address-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 10px;
    }

    .food-address-street {
        grid-column: auto;
    }

    .food-address-picker label {
        gap: 4px;
    }

    .food-address-picker select,
    .food-address-picker input {
        height: 44px;
        padding-inline: 9px;
        /* iOS zooms the whole viewport when a focused form control is below
         * 16px, which makes the left edge appear clipped after typing. */
        font-size: 16px;
    }

    .food-app[data-page="home"] :is(input, select, textarea) {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 16px;
    }

    .food-app[data-page="home"] .food-filter-row {
        order: 4;
        margin-top: 14px;
        padding: 0 0 4px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
    }

    .food-filter-wrap,
    .food-filter-row > .food-filter {
        min-width: 0;
        width: 100%;
    }

    .food-app[data-page="home"] .food-filter-row > .food-filter-wrap:last-child {
        grid-column: auto;
    }

    .food-filter {
        min-height: 66px;
        padding: 8px 10px;
    }

    .food-filter span {
        gap: 6px;
        font-size: 12px;
    }

    .food-filter span img {
        width: 20px;
        height: 20px;
    }

    .food-filter strong {
        font-size: 14px;
    }

    .food-app[data-page="home"] .food-prompt-box {
        order: 3;
        width: 100%;
        max-width: 100%;
        align-self: stretch;
        min-height: 70px;
        margin-top: 14px;
        padding: 10px 12px;
        flex-wrap: nowrap;
        gap: 9px;
        border-radius: 14px;
    }

    .food-prompt-box > img {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
    }

    .food-prompt-box input {
        min-width: 0;
        font-size: 16px;
    }

    .food-prompt-box button {
        width: auto;
        min-width: 110px;
        height: 46px;
        padding: 0 12px;
        font-size: 13px;
    }

    .food-app[data-page="home"] .food-content-grid {
        order: 5;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        margin-top: 20px;
    }

    .food-app[data-page="results"] .food-result-layout,
    .food-app[data-page="detail"] .food-detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .food-app[data-page="home"] .food-disclaimer {
        order: 6;
    }

    .food-app[data-page="home"] .fuuvo-ai-disclaimer {
        order: 7;
    }

    .food-start-section h2,
    .food-method-panel h2 {
        margin-bottom: 11px;
        font-size: 18px;
    }

    .food-quick-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        overflow: visible;
    }

    .food-quick-card {
        min-width: 0;
        width: 100%;
        min-height: 100px;
        padding: 11px 7px 9px;
    }

    .food-quick-card img {
        width: 43px;
        height: 43px;
    }

    .food-method-panel {
        padding: 14px 12px 10px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .food-method-panel h2 {
        grid-column: 1 / -1;
    }

    .food-method-panel button {
        min-height: 86px;
        padding: 8px 5px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        border: 1px solid var(--food-line);
        border-radius: 10px;
        font-size: 12px;
        text-align: center;
    }

    .food-method-panel button:first-of-type {
        border-top: 1px solid var(--food-line);
    }

    .food-method-panel button img {
        width: 28px;
        height: 28px;
    }

    .food-method-panel button b {
        display: none;
    }

    html:has(body .food-filter-menu:not([hidden])),
    body:has(.food-filter-menu:not([hidden])) {
        height: 100dvh;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body:has(.food-filter-menu:not([hidden]))::before {
        position: fixed;
        inset: 0;
        z-index: 329;
        background: rgba(8, 15, 28, .52);
        backdrop-filter: blur(2px);
        content: "";
    }

    html body .food-filter-menu:not([hidden]) {
        position: fixed !important;
        left: max(10px, env(safe-area-inset-left)) !important;
        right: max(10px, env(safe-area-inset-right)) !important;
        top: auto !important;
        bottom: 0 !important;
        z-index: 330 !important;
        width: auto !important;
        max-width: none !important;
        max-height: min(64dvh, 520px) !important;
        padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        border-bottom: 0;
        border-radius: 22px 22px 0 0;
        overflow-x: hidden;
        overflow-y: auto;
        box-shadow: 0 -18px 48px rgba(15, 23, 42, .24);
    }

    .food-filter-menu:not([hidden])::before {
        grid-column: 1 / -1;
        margin: 0 2px 8px;
        color: var(--food-ink);
        font-size: 17px;
        font-weight: 750;
        content: attr(aria-label);
    }

    .food-filter-option {
        min-height: 44px;
        border: 1px solid var(--food-line);
        background: #f8fafc;
    }

    body[data-ui-theme="dark"] .food-filter-menu:not([hidden])::before {
        color: #f8fafc;
    }

    body[data-ui-theme="dark"] .food-filter-option {
        border-color: #34445d;
        background: #172338;
        color: #f2f6fc;
    }

    body[data-ui-theme="dark"] .food-filter-option:hover,
    body[data-ui-theme="dark"] .food-filter-option:focus-visible,
    body[data-ui-theme="dark"] .food-filter-option[aria-selected="true"] {
        background: #213957;
        color: #b9dcff;
    }

    /* Creation centre: denser header/categories and balanced touch cards. */
    #creation-app[data-creation-page="home"] .creation-heading h1 {
        font-size: clamp(28px, 8vw, 32px);
    }

    #creation-app[data-creation-page="home"] .creation-heading p {
        margin-top: 7px;
        font-size: 13px;
        line-height: 1.45;
    }

    #creation-app[data-creation-page="home"] .creation-tabs {
        margin-top: 18px;
    }

    #creation-app[data-creation-page="home"] .creation-category-tabs {
        margin-top: 16px;
        gap: 7px !important;
    }

    #creation-app[data-creation-page="home"] .creation-category-tabs a {
        min-height: 68px !important;
        padding: 6px 4px !important;
        font-size: 12.5px;
    }

    #creation-app[data-creation-page="home"] .creation-section-title {
        margin-top: 18px;
        margin-bottom: 10px;
        font-size: 21px;
    }

    #creation-app[data-creation-page="home"] .creation-app-list {
        gap: 9px;
    }

    #creation-app[data-creation-page="home"] .creation-app-entry {
        min-height: 140px !important;
        padding: 9px 5px !important;
    }

    #creation-app[data-creation-page="home"] .creation-app-entry-art {
        width: 60px !important;
        height: 60px !important;
        flex-basis: 60px !important;
    }

    #creation-app[data-creation-page="writing"] .writing-card-art {
        width: 60px !important;
        height: 60px !important;
        flex-basis: 60px !important;
    }

    #creation-app[data-creation-page="home"] .creation-app-entry-copy strong {
        font-size: 14px;
    }

    #creation-app[data-creation-page="home"] .creation-app-entry-copy small {
        font-size: 11.5px;
        line-height: 1.35;
    }

    @media (min-width: 360px) {
        .detail-chip-row {
            grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        }

        .detail-chip-row button {
            width: 100% !important;
            min-width: 0 !important;
            padding-inline: 6px !important;
            white-space: normal;
            text-align: center;
        }
    }
}

@media (min-width: 480px) and (max-width: 599px) {
    .food-app[data-page="home"] .food-filter-row,
    .food-address-picker,
    .food-quick-grid,
    .food-method-panel,
    html body .food-filter-menu:not([hidden]) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 600px) and (max-width: 920px), (hover: none) and (pointer: coarse) and (min-width: 600px) and (max-width: 1366px) {
    .food-app[data-page="home"] .food-filter-row,
    .food-quick-grid,
    html body .food-filter-menu:not([hidden]) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .food-method-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .food-address-picker {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .zodiac-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .fortune-topic-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .fortune-panel.fortune-side-info {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .creation-app-list,
    .voice-grid,
    .writing-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 560px) {
    .workspace-chat-header,
    .creation-topbar,
    .portal-topbar {
        min-height: 56px !important;
    }

    .topbar-settings-backdrop {
        inset: 56px 0 0 !important;
    }

    .topbar-settings-drawer {
        top: 56px !important;
    }

    :where(.auth-overlay, .settings-overlay, .user-settings-overlay, .legal-doc-overlay, .legal-overlay, .modal-backdrop) {
        align-items: flex-start !important;
        padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)) !important;
    }

    :where(.auth-dialog, .settings-dialog, .legal-doc-dialog, .legal-dialog, .modal) {
        max-height: calc(100dvh - 16px) !important;
        border-radius: 16px !important;
    }

    .auth-dialog {
        top: 8px !important;
        transform: translateX(-50%) !important;
    }

    .zodiac-grid,
    .fortune-topic-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .research-tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .food-address-picker {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 359px) {
    .settings-dialog .settings-nav {
        gap: 4px !important;
    }

    .settings-dialog .settings-nav-btn {
        padding-inline: 3px !important;
        font-size: 12px !important;
    }

    .creation-category-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .creation-category-tabs a {
        min-height: 66px !important;
        flex-direction: column !important;
        padding-inline: 3px !important;
        font-size: 11px !important;
    }

    .detail-chip-row {
        grid-template-columns: 1fr !important;
    }

    .research-tool-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .research-tool-card {
        min-height: 112px;
        padding: 11px;
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 12px;
        align-content: center;
        text-align: left;
    }

    .research-tool-art {
        width: 82px;
        height: 76px;
        grid-row: 1 / 3;
    }

    .research-tool-card h2 {
        align-self: end;
        margin: 0 0 4px;
    }

    .research-tool-card p {
        align-self: start;
    }

    .analysis-process-panel article {
        min-height: 150px;
    }

    .analysis-upload-drop {
        min-height: 118px;
        padding-block: 10px;
    }

    .analysis-upload-drop img {
        width: 44px;
        height: 44px;
    }

    .analysis-upload-drop strong {
        margin-top: 6px;
        font-size: 15px;
    }

    .analysis-upload-drop > span {
        margin-top: 3px;
    }

    .analysis-prompt-title {
        margin: 10px 0 6px;
    }

    .analysis-drop-notes {
        min-height: 46px;
        padding-block: 6px;
    }

    .analysis-prompt {
        min-height: 88px;
    }

    .analysis-home-footer {
        margin-top: 8px;
    }

    .food-prompt-box button {
        min-width: 96px;
        padding-inline: 9px;
    }
}

/* Unified compact mobile topbar: keep the menu and language switch aligned
   consistently across the homepage, shared workspaces, and standalone pages. */
@media (max-width: 920px) {
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] #desktop-new-chat-icon {
        display: none !important;
    }

    html body.chat-detail-open[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .chat-detail-back-desktop:not(.hidden) {
        order: 2 !important;
        min-width: 0 !important;
        width: auto !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 4px 0 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        border: 0 !important;
        background: transparent !important;
        color: inherit !important;
        box-shadow: none !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        white-space: nowrap !important;
    }

    html body.chat-detail-open[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .chat-detail-back-desktop svg {
        width: 18px !important;
        height: 18px !important;
        flex: 0 0 18px !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] [data-toggle-shared-sidebar] {
        order: 1 !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] #desktop-my-creations-btn,
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] #desktop-media-drawer-toggle {
        display: none !important;
    }

    html body header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-login, .creation-login, .portal-login) {
        display: none !important;
    }

    html body .mobile-chat-topbar,
    html body header[data-fuuvo-shared-topbar="1"],
    html body .workspace-chat-header,
    html body .creation-topbar,
    html body .portal-topbar,
    html body .content-shell > .topbar {
        height: 64px !important;
        min-height: 64px !important;
        max-height: 64px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: max(10px, env(safe-area-inset-left)) !important;
        padding-right: max(10px, env(safe-area-inset-right)) !important;
        box-sizing: border-box !important;
    }

    html body .mobile-nav-bars,
    html body .mobile-nav-bars :is(img, svg),
    html body [data-toggle-shared-sidebar] .fuuvo-topbar-menu-icon,
    html body [data-toggle-shared-sidebar] .fuuvo-topbar-menu-icon > img {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
    }

    /* The homepage now uses the same shared topbar as feature/detail pages. */
    html body.chat-landing[data-mode="chat"] .mobile-chat-topbar {
        display: none !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 8px !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-left,
    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-right {
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-left {
        gap: 8px !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-right {
        grid-column: 3 !important;
        justify-content: flex-end !important;
        gap: 8px !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .desktop-action-icon,
    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-header-login,
    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-header-link > span {
        display: none !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-center {
        grid-column: 2 !important;
        min-width: 0 !important;
        display: none !important;
        align-items: center !important;
        justify-content: flex-start !important;
        overflow: hidden !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title {
        min-width: 0 !important;
        max-width: 100% !important;
        display: none !important;
        overflow: hidden !important;
        color: inherit !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        visibility: hidden !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] #workspace-chat-subtitle {
        display: none !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .home-mobile-header-back {
        order: 2 !important;
        min-width: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 3px !important;
        color: inherit !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] [data-toggle-shared-sidebar] {
        order: 1 !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .home-mobile-header-back svg {
        width: 18px !important;
        height: 18px !important;
        fill: none !important;
        stroke: currentColor !important;
        stroke-width: 2 !important;
        stroke-linecap: round !important;
        stroke-linejoin: round !important;
    }

    /* Shared mobile topbar contract for every feature/detail page. */
    html body header[data-fuuvo-shared-topbar="1"] .shell-topbar-left,
    html body header[data-fuuvo-shared-topbar="1"] .shell-topbar-right {
        min-width: 0 !important;
        align-items: center !important;
    }

    html body header[data-fuuvo-shared-topbar="1"] :is(#feature-shell-title, .portal-topbar-title, .shell-topbar-suffix, .shell-topbar-middle) {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] #desktop-my-creations-btn,
    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] #desktop-media-drawer-toggle {
        display: none !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-header-link:not(.hidden) {
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        padding: 6px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    html body.chat-landing[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-header-link:not(.hidden) > img {
        width: 22px !important;
        height: 22px !important;
        display: block !important;
    }
}

/* Final narrow-phone authority (kept after the shared 920px contract). */
@media (max-width: 430px) {
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] {
        width:100% !important;
        max-width:100vw !important;
        grid-template-columns:minmax(0, auto) minmax(48px, 1fr) auto !important;
        gap:5px !important;
        padding-left:max(7px, env(safe-area-inset-left)) !important;
        padding-right:max(7px, env(safe-area-inset-right)) !important;
        overflow:hidden !important;
    }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-left { gap:3px !important; overflow:hidden !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-center { justify-content:center !important; overflow:hidden !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title { max-width:100% !important; font-size:17px !important; text-align:center !important; text-overflow:ellipsis !important; white-space:nowrap !important; overflow:hidden !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-right { flex:0 0 auto !important; gap:3px !important; overflow:visible !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-link, .creation-top-safety, .portal-top-safety-link) { width:30px !important; min-width:30px !important; height:34px !important; padding:5px !important; flex-basis:30px !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch { height:38px !important; min-height:38px !important; padding:2px !important; gap:1px !important; flex:0 0 auto !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch .ui-language-switch-btn { width:32px !important; min-width:32px !important; height:32px !important; min-height:32px !important; padding:0 3px !important; font-size:13px !important; line-height:32px !important; }
}

@media (max-width: 430px) {
    html body.chat-detail-open[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .chat-detail-back-desktop span { display:none !important; }
    html body.chat-detail-open[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .chat-detail-back-desktop { width:28px !important; flex:0 0 28px !important; padding:0 !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title { font-size:16px !important; }
}

@media (max-width: 350px) {
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] {
        grid-template-columns:minmax(0, auto) minmax(38px, 1fr) auto !important;
        gap:3px !important;
        padding-left:max(5px, env(safe-area-inset-left)) !important;
        padding-right:max(5px, env(safe-area-inset-right)) !important;
    }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title { font-size:15px !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-right { gap:1px !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch .ui-language-switch-btn { width:30px !important; min-width:30px !important; padding:0 2px !important; }
}

/* Narrow phones: protect the right-side safety/language controls from being
   pushed outside the viewport by the back label and the conversation title. */
@media (max-width: 430px) {
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] {
        width:100% !important;
        max-width:100vw !important;
        grid-template-columns:minmax(0, auto) minmax(48px, 1fr) auto !important;
        column-gap:5px !important;
        padding-left:max(7px, env(safe-area-inset-left)) !important;
        padding-right:max(7px, env(safe-area-inset-right)) !important;
        overflow:hidden !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-left {
        gap:3px !important;
        overflow:hidden !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-center {
        justify-content:center !important;
        overflow:hidden !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title {
        max-width:100% !important;
        font-size:17px !important;
        text-align:center !important;
        text-overflow:ellipsis !important;
        white-space:nowrap !important;
        overflow:hidden !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-right {
        flex:0 0 auto !important;
        gap:3px !important;
        overflow:visible !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-link, .creation-top-safety, .portal-top-safety-link) {
        width:30px !important;
        min-width:30px !important;
        height:34px !important;
        padding:5px !important;
        flex-basis:30px !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch {
        height:38px !important;
        min-height:38px !important;
        padding:2px !important;
        gap:1px !important;
        flex:0 0 auto !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch .ui-language-switch-btn {
        width:32px !important;
        min-width:32px !important;
        height:32px !important;
        min-height:32px !important;
        padding:0 3px !important;
        font-size:13px !important;
        line-height:32px !important;
    }
}

@media (max-width: 370px) {
    html body.chat-detail-open[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .chat-detail-back-desktop span {
        display:none !important;
    }

    html body.chat-detail-open[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .chat-detail-back-desktop {
        width:28px !important;
        flex:0 0 28px !important;
        padding:0 !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title {
        font-size:16px !important;
    }
}

@media (min-width: 921px) {
    .home-mobile-header-back {
        display: none !important;
    }
}

/* Final chat header contract: landing and conversation/input views share the
   same compact header, including the smaller language control. */
@media (max-width: 920px) {
    html body[data-mode="chat"] .mobile-chat-topbar {
        display: none !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] {
        height: 64px !important;
        min-height: 64px !important;
        max-height: 64px !important;
        padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)) !important;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 8px !important;
        box-sizing: border-box !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-left,
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-right {
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-center {
        min-width: 0 !important;
        display: flex !important;
        visibility: visible !important;
        overflow: hidden !important;
    }

    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title {
        visibility: visible !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html body header[data-fuuvo-shared-topbar="1"] :is(.ui-language-switch, .creation-language, .portal-language) {
        min-width: 0 !important;
        min-height: 0 !important;
        height: 42px !important;
        padding: 2px !important;
        gap: 2px !important;
        border-radius: 9px !important;
        box-sizing: border-box !important;
    }

    html body header[data-fuuvo-shared-topbar="1"] :is(.ui-language-switch-btn, .creation-language a, .portal-language a) {
        width: 38px !important;
        min-width: 38px !important;
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 6px !important;
        border-radius: 7px !important;
        font-size: 14px !important;
        line-height: 36px !important;
        box-sizing: border-box !important;
    }

    /* Safety centre uses the same shield asset and sizing as Fortune pages. */
    html body header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-link, .creation-top-safety, .portal-top-safety-link) {
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        padding: 6px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 34px !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    html body header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-link, .creation-top-safety, .portal-top-safety-link) > img.fuuvo-design-icon {
        width: 22px !important;
        min-width: 22px !important;
        height: 22px !important;
        min-height: 22px !important;
        display: block !important;
        object-fit: contain !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    html body header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-link, .creation-top-safety, .portal-top-safety-link) > span {
        display: none !important;
    }
}

/* Final narrow-phone authority: keep the language control inside the viewport. */
@media (max-width: 430px) {
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] {
        width:100% !important;
        max-width:100vw !important;
        grid-template-columns:minmax(0, auto) minmax(48px, 1fr) auto !important;
        gap:5px !important;
        padding-left:max(7px, env(safe-area-inset-left)) !important;
        padding-right:max(7px, env(safe-area-inset-right)) !important;
        overflow:hidden !important;
    }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-left { gap:3px !important; overflow:hidden !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-center { justify-content:center !important; overflow:hidden !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title { max-width:100% !important; font-size:17px !important; text-align:center !important; text-overflow:ellipsis !important; white-space:nowrap !important; overflow:hidden !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-right { flex:0 0 auto !important; gap:3px !important; overflow:visible !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] :is(.workspace-header-link, .creation-top-safety, .portal-top-safety-link) { width:30px !important; min-width:30px !important; height:34px !important; padding:5px !important; flex-basis:30px !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch { height:38px !important; min-height:38px !important; padding:2px !important; gap:1px !important; flex:0 0 auto !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch .ui-language-switch-btn { width:32px !important; min-width:32px !important; height:32px !important; min-height:32px !important; padding:0 3px !important; font-size:13px !important; line-height:32px !important; }
}

@media (max-width: 430px) {
    html body.chat-detail-open[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .chat-detail-back-desktop span { display:none !important; }
    html body.chat-detail-open[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .chat-detail-back-desktop { width:28px !important; flex:0 0 28px !important; padding:0 !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title { font-size:16px !important; }
}

@media (max-width: 350px) {
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] {
        grid-template-columns:minmax(0, auto) minmax(38px, 1fr) auto !important;
        gap:3px !important;
        padding-left:max(5px, env(safe-area-inset-left)) !important;
        padding-right:max(5px, env(safe-area-inset-right)) !important;
    }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .workspace-chat-title { font-size:15px !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .shell-topbar-right { gap:1px !important; }
    html body[data-mode="chat"] header[data-fuuvo-shared-topbar="1"] .ui-language-switch .ui-language-switch-btn { width:30px !important; min-width:30px !important; padding:0 2px !important; }
}

/* Chat titles use the viewport centre, with equal space for both action groups. */
@media (max-width: 920px) {
    html body[data-mode="chat"] header.workspace-chat-header[data-fuuvo-shared-topbar="1"] {
        --chat-header-side-width: 128px;
        grid-template-columns: minmax(var(--chat-header-side-width), 1fr) minmax(0, 2fr) minmax(var(--chat-header-side-width), 1fr) !important;
        padding-left: max(10px, env(safe-area-inset-left), env(safe-area-inset-right)) !important;
        padding-right: max(10px, env(safe-area-inset-left), env(safe-area-inset-right)) !important;
    }
    html body[data-mode="chat"] header.workspace-chat-header[data-fuuvo-shared-topbar="1"] .shell-topbar-left {
        grid-column: 1 !important;
        justify-self: start !important;
    }
    html body[data-mode="chat"] header.workspace-chat-header[data-fuuvo-shared-topbar="1"] .shell-topbar-center {
        grid-column: 2 !important;
        justify-self: stretch !important;
        justify-content: center !important;
        display: flex !important;
        width: 100% !important;
        visibility: visible !important;
    }
    html body[data-mode="chat"] header.workspace-chat-header[data-fuuvo-shared-topbar="1"] .workspace-chat-title {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        text-align: center !important;
        visibility: visible !important;
    }
    html body[data-mode="chat"] header.workspace-chat-header[data-fuuvo-shared-topbar="1"] .shell-topbar-right {
        grid-column: 3 !important;
        justify-self: end !important;
    }
}
@media (max-width: 430px) {
    html body[data-mode="chat"] header.workspace-chat-header[data-fuuvo-shared-topbar="1"] {
        --chat-header-side-width: 120px;
        padding-left: max(7px, env(safe-area-inset-left), env(safe-area-inset-right)) !important;
        padding-right: max(7px, env(safe-area-inset-left), env(safe-area-inset-right)) !important;
    }
}
@media (max-width: 350px) {
    html body[data-mode="chat"] header.workspace-chat-header[data-fuuvo-shared-topbar="1"] {
        padding-left: max(5px, env(safe-area-inset-left), env(safe-area-inset-right)) !important;
        padding-right: max(5px, env(safe-area-inset-left), env(safe-area-inset-right)) !important;
    }
}

/* Source: public/static/css/fuuvo-mobile-pages.css */
/*
 * Unified mobile page contract.
 *
 * Feature styles are intentionally allowed to own their visual language. This
 * layer only owns the mobile frame: viewport sizing, document scrolling,
 * readable gutters, single-column flow, safe-area spacing and touch targets.
 * It is loaded last so older page-specific desktop rules cannot reintroduce a
 * fixed-width or nested-scroll layout on a phone.
 */

@media (max-width: 920px) {
    :root {
        --fuuvo-mobile-gutter: max(14px, env(safe-area-inset-left));
        --fuuvo-mobile-gutter-right: max(14px, env(safe-area-inset-right));
        --fuuvo-mobile-header-height: 64px;
    }

    html {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden !important;
        overflow-y: auto;
        overscroll-behavior-y: auto;
    }

    /* Public shells use the document as the only vertical scroller. */
    body > :is(.creation-app, .feature-shell, .portal-shell, .app-shell, .kc-app-shell),
    body > [data-fuuvo-app-shell="1"] {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 100dvh !important;
        height: auto !important;
        max-height: none !important;
        display: block !important;
        overflow: visible !important;
    }

    body > :is(.creation-app, .feature-shell, .portal-shell, .app-shell, .kc-app-shell) > :is(.creation-workspace, .portal-content, .workspace, .content-shell, .kc-app-workspace),
    body > [data-fuuvo-app-shell="1"] [data-fuuvo-app-workspace="1"] {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 100dvh !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* The shared sidebar already has its drawer behavior. Custom legacy
     * sidebars need the same mobile affordance instead of stealing width. */
    body > .feature-shell > .feature-sidebar,
    body > .app-shell > .sidebar,
    body > .content-shell > .sidebar {
        display: none !important;
    }

    body :is(header[data-fuuvo-shared-topbar="1"], .workspace-chat-header, .creation-topbar, .portal-topbar, .kc-topbar, .topbar, .content-shell > .topbar) {
        position: sticky !important;
        top: 0 !important;
        z-index: 80 !important;
        width: 100% !important;
        min-height: var(--fuuvo-mobile-header-height) !important;
        height: var(--fuuvo-mobile-header-height) !important;
        max-height: var(--fuuvo-mobile-header-height) !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: var(--fuuvo-mobile-gutter) !important;
        padding-right: var(--fuuvo-mobile-gutter-right) !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        border-bottom: 1px solid rgba(148, 163, 184, .16) !important;
        background: color-mix(in srgb, var(--fuuvo-mobile-surface, #fff) 94%, transparent) !important;
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }

    body :is(.topbar, .kc-topbar, .content-shell > .topbar) {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    body :is(.topbar, .kc-topbar, .content-shell > .topbar) > * {
        min-width: 0;
    }

    body :is(.top-title, .topbar-title, .kc-topbar-title) {
        min-width: 0;
        max-width: 54vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 16px !important;
    }

    body :is(.top-actions, .topbar-actions, .kc-topbar-actions) {
        min-width: 0;
        gap: 6px !important;
        white-space: nowrap;
    }

    body :is(.top-safety-link, .portal-top-safety-link) span,
    body :is(.top-actions, .topbar-actions) .login-link span {
        display: none;
    }

    /* One predictable content gutter for every public page family. */
    body :is(
        .creation-main,
        .analysis-main,
        .food-main,
        .fortune-main,
        .office-main,
        .pricing-main,
        .membership-main,
        .ai-document-main,
        .main,
        .portal-main,
        .kc-container,
        .purchased-services-main,
        .payment-result
    ) {
        width: calc(100% - 28px) !important;
        max-width: none !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body :is(.creation-main, .analysis-main, .food-main, .fortune-main, .office-main, .pricing-main, .membership-main, .ai-document-main, .main, .portal-main) {
        padding-top: 24px !important;
        padding-bottom: max(46px, env(safe-area-inset-bottom)) !important;
        overflow: visible !important;
    }

    /* Page grids become a clear vertical reading order. Small repeat grids
     * remain two-up only where the cards are icon-sized or explicitly data
     * oriented. */
    body :is(
        .creation-layout,
        .creation-work-grid,
        .research-work-grid,
        .learning-layout,
        .analysis-layout,
        .analysis-setup-layout,
        .analysis-result-layout,
        .food-content-grid,
        .food-result-layout,
        .food-detail-layout,
        .fortune-layout,
        .fortune-result-layout,
        .office-tool-layout,
        .service-use-layout,
        .feature-layout,
        .kc-article-layout,
        .legal-article-layout,
        .safety-page-layout,
        .portal-layout,
        .data-control-layout,
        .account-data-layout,
        .ai-card-layout
    ) {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body :is(
        .creation-grid,
        .creation-inspiration-grid,
        .creation-visual-grid,
        .research-tool-grid,
        .research-result-cards,
        .food-quick-grid,
        .food-reference-grid,
        .fortune-reading-grid,
        .feature-grid,
        .control-grid,
        .report-cards,
        .membership-plan-grid,
        .purchased-service-grid,
        .recommendations,
        .kc-card-grid,
        .kc-flow,
        .stripe-plan-grid
    ) {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    body :is(.creation-sidebar, .research-side, .analysis-settings-side, .analysis-result-side, .food-method-panel, .food-refine-panel, .fortune-side-info, .office-result-card, .kc-article-nav, .kc-toc, .portal-side, .safety-page-toc) {
        width: 100% !important;
        margin: 16px 0 0 !important;
        position: static !important;
    }

    body :is(.settings-panel, .analysis-settings-side, .office-tool-form-card, .office-result-card, .food-info-panel, .fortune-setup, .fortune-continue, .kc-side-support, .legal-side-support) {
        padding: 16px !important;
    }

    body :is(.creation-card, .creation-visual-card, .research-tool-card, .research-result-card, .food-restaurant-card, .fortune-reading-grid > article, .feature-card, .control-card, .report-card, .membership-plan-card, .purchased-service-card, .kc-topic-card, .stripe-plan-card) {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    body :is(button, a, input, select, textarea, summary) {
        max-width: 100%;
    }

    body :is(button, [role="button"], a[class*="-button"], a[class*="-btn"], .primary-button, .outline-button, .login-link) {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
        max-width: 100%;
        font-size: 16px !important;
    }

    body :is(textarea, .composer textarea, .research-input textarea, .analysis-prompt, .office-start-panel textarea, .office-tool-form-card textarea) {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 112px;
        line-height: 1.55;
    }

    body :is(.categories, .research-tabs, .creation-tabs, .office-tabs, .membership-period, .translation-tabs, .detail-option-row) {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    body :is(.categories, .research-tabs, .creation-tabs, .office-tabs, .membership-period, .translation-tabs, .detail-option-row)::-webkit-scrollbar {
        display: none;
    }

    body :is(.table-wrap, .data-preview-table, .office-result-table, .analysis-spreadsheet-preview, .spreadsheet-grid-wrap, .presentation-template-grid) {
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body :is(table, .data-preview-table table, .office-result-table table) {
        max-width: none;
    }

    body :is(pre, code, .result-content, .service-result-content, .kc-copy) {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body :is(dialog, .modal, .modal-backdrop .modal, .wechat-payment-dialog, .topbar-settings-drawer, .workspace-account-dropdown) {
        max-width: calc(100vw - 24px) !important;
    }

    body :is(.modal-backdrop, .wechat-payment-modal) {
        padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)) !important;
    }

    /* Knowledge/legal pages have a three-column desktop reading layout. Keep
     * the article navigation available as a compact horizontal strip. */
    body :is(.kc-article-nav, .legal-document-nav) nav {
        display: flex !important;
        max-width: 100%;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    body :is(.kc-article-nav, .legal-document-nav) nav a {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 9px 12px !important;
        white-space: nowrap;
    }

    body :is(.kc-toc, .legal-page-toc) {
        display: none !important;
    }

    /* Media preview controls must stay visible above the safe area. */
    body.preview-embedded :is(.preview-toolbar, .preview-header, .preview-actions) {
        flex-wrap: wrap;
        gap: 6px;
    }

    body.preview-embedded :is(.preview-stage, .preview-frame-wrap, .preview-image-wrap) {
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Auth screens are intentionally calm and single-column on phones. */
    body :is(.auth-page, .auth-shell) {
        min-height: 100dvh;
        width: 100%;
    }

    body :is(.auth-header, .auth-page .auth-header) {
        height: auto !important;
        min-height: 78px !important;
        padding: 14px var(--fuuvo-mobile-gutter) !important;
    }

    body :is(.auth-header .brand > img, .auth-brand > img) {
        width: min(190px, 62vw) !important;
        max-width: 100%;
    }

    body :is(.auth-main, .auth-content, .auth-layout) {
        width: calc(100% - 28px) !important;
        max-width: 520px !important;
        margin: 0 auto !important;
        padding: 28px 0 max(48px, env(safe-area-inset-bottom)) !important;
        display: block !important;
    }

    body :is(.auth-card, .auth-panel, .auth-showcase-card) {
        width: 100% !important;
        max-width: 100% !important;
        padding: 22px 18px !important;
    }

}

@media (max-width: 430px) {
    body :is(.creation-main, .analysis-main, .food-main, .fortune-main, .office-main, .pricing-main, .membership-main, .ai-document-main, .main, .portal-main, .kc-container, .purchased-services-main) {
        width: calc(100% - 22px) !important;
        padding-top: 20px !important;
    }

    body :is(.hero h1, .creation-heading h1, .research-home-heading h1, .food-heading h1, .analysis-heading h1, .fortune-hero h1, .office-heading h1, .membership-hero h1, .portal-heading h1, .portal-hero h1) {
        font-size: clamp(23px, 8vw, 28px) !important;
        line-height: 1.28 !important;
    }

    body :is(.card, .feature-card, .kc-topic-card, .membership-plan-card, .purchased-service-card) {
        padding: 16px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body :is(*, *::before, *::after) {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* Keep desktop hover transforms from causing accidental movement on touch. */
@media (max-width: 920px) and (hover: none) {
    body :is(.feature-card, .kc-topic-card, .membership-plan-card, .purchased-service-card, .creation-card) {
        transform: none !important;
    }
}

@media (max-width: 920px) {
    html[data-theme="dark"] body :is(header[data-fuuvo-shared-topbar="1"], .workspace-chat-header, .creation-topbar, .portal-topbar, .kc-topbar, .topbar, .content-shell > .topbar),
    html[data-ui-theme="dark"] body :is(header[data-fuuvo-shared-topbar="1"], .workspace-chat-header, .creation-topbar, .portal-topbar, .kc-topbar, .topbar, .content-shell > .topbar),
    body[data-theme="dark"] :is(header[data-fuuvo-shared-topbar="1"], .workspace-chat-header, .creation-topbar, .portal-topbar, .kc-topbar, .topbar, .content-shell > .topbar),
    body[data-ui-theme="dark"] :is(header[data-fuuvo-shared-topbar="1"], .workspace-chat-header, .creation-topbar, .portal-topbar, .kc-topbar, .topbar, .content-shell > .topbar) {
        border-bottom-color: rgba(148, 163, 184, .2) !important;
        background: rgba(10, 23, 40, .94) !important;
    }
}
