/* Only the opt-in iPad pages receive data-is-tablet-mode. PC, phones, news and
   novel pages retain the existing media-query contracts. No viewport scaling. */
html[data-is-tablet-mode="mobile"] body.mobile-main-shell {
    --header-height: var(--mobile-primary-header-height) !important;
    --mobile-primary-content-start-gap: 12px;
}
html[data-is-tablet-mode="mobile"] body.mobile-main-shell .mobile-primary-header {
    position: fixed;
    z-index: 1000;
    inset: 0 0 auto;
    display: block;
    width: 100%;
    min-width: 0;
    height: var(--mobile-primary-header-height);
}
html[data-is-tablet-mode="mobile"] body.mobile-main-shell .improved-header { display: none !important; }
html[data-is-tablet-mode="mobile"] body.mobile-main-shell .right-sidebar-menu {
    top: calc(var(--mobile-primary-topbar-height) + env(safe-area-inset-top, 0px)) !important;
    height: calc(100dvh - var(--mobile-primary-topbar-height) - env(safe-area-inset-top, 0px)) !important;
    max-height: calc(100dvh - var(--mobile-primary-topbar-height) - env(safe-area-inset-top, 0px)) !important;
}
html[data-is-tablet-mode="mobile"] body.mobile-primary-title-integrated [data-mobile-primary-title-source],
html[data-is-tablet-mode="mobile"] body.mobile-primary-title-integrated [data-mobile-primary-title-block="collapse"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
}
html[data-is-tablet-mode="mobile"] body.mobile-primary-title-integrated [data-mobile-primary-title-support] { display: none !important; }
html[data-is-tablet-mode="mobile"] body.mobile-primary-title-integrated.mobile-main-shell.fc-forum-app main.board-list-page .board-page-hero {
    top: auto !important;
    min-height: 0 !important;
    height: 12px !important;
    padding: 0 !important;
}
html[data-is-tablet-mode="mobile"] body.mobile-primary-title-integrated.mobile-main-shell.fc-forum-app main.board-list-page .board-page-hero :is([data-mobile-primary-title-support], .board-rss-badge) { display: none !important; }
html[data-is-tablet-mode="mobile"] body.mobile-primary-title-integrated.fc-forum-app main.board-list-page .board-hero-title-line { justify-content: flex-end !important; }
html[data-is-tablet-mode="mobile"] body.is-mobile-home { --imh-page-gutter: 28px; }
html[data-is-tablet-mode="mobile"] body.is-mobile-home :is(.imh-app, .imh-bottom-nav) { max-width: 100%; }
/* An unsent home search keeps its document on rotation; don't shrink it to 520px. */
html[data-is-tablet-mode="desktop"] body.is-mobile-home :is(.imh-app, .imh-bottom-nav) { max-width: 100%; }
html[data-is-tablet-mode="mobile"] body.is-mobile-home .imh-search-section { padding-top: 12px; }

/* The desktop header still fits a 1024px iPad; the body keeps its service layout. */
html[data-is-tablet-mode="desktop"] body.mobile-main-shell { --header-height: 70px !important; }
html[data-is-tablet-mode="desktop"] body.mobile-main-shell .mobile-primary-header { display: none !important; }
html[data-is-tablet-mode="desktop"] body.mobile-main-shell .improved-header { display: block !important; }
html[data-is-tablet-mode="desktop"] .improved-header .header-container { width: 100%; max-width: 1200px; min-width: 0; }
html[data-is-tablet-mode="desktop"] .improved-header .header-center { min-width: 0; }
html[data-is-tablet-mode="desktop"] .improved-header .main-navigation { display: flex; }

/* Active app directory shared by Content/insurance_platform and unified_search. */
html[data-is-tablet-mode="mobile"] .app-hub-v4 {
    width: calc(100% - 32px);
    padding-top: var(--mobile-primary-header-height, 110px);
}
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 18px 0 14px;
}
html[data-is-tablet-mode="mobile"] .app-hub-v4 :is(.app-hub-v4__intro p, .app-hub-v4__search label, .app-hub-v4__platform-count, .app-hub-v4__result) { display: none; }
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__search-field { min-height: 46px; }
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__search-field input { height: 44px; }
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__platforms {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding-bottom: 14px;
}
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__platform {
    min-height: 52px;
    justify-content: center;
    padding: 5px 8px;
}
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__platform strong {
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
}
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__toolbar { display: block; min-height: 0; padding: 0; }
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__categories { display: flex; width: 100%; gap: 0; overflow-x: auto; }
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__category { flex: 1 0 auto; min-height: 44px; padding: 0 14px; font-size: 13px; }
html[data-is-tablet-mode="mobile"] .app-hub-v4 :is(.app-hub-v4__group, .app-hub-v4__service-list, .app-hub-v4__carinfo-grid) { grid-template-columns: minmax(0, 1fr); gap: 12px; }
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__carinfo-column { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--app-hub-v4-line); }
html[data-is-tablet-mode="mobile"] .app-hub-v4 .app-hub-v4__carinfo-column:first-child { padding-top: 0; border-top: 0; }
