/*
 * iPad layout integration for claim routes.
 * Orientation changes only resize the active DOM; form state and wizard logic stay intact.
 */

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-hub {
    min-height: 100svh;
    min-height: 100dvh;
    display: block;
    padding: calc(var(--header-height, 45px) + 18px) 16px calc(28px + env(safe-area-inset-bottom, 0px));
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-hub__inner {
    width: 100%;
    max-width: none;
    display: block;
    margin: 0 auto;
    transform: none;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-hub__head,
html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-intro-points,
html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-choice-head > span,
html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-choice-head > h2 {
    display: none;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-choice-head {
    display: block;
    margin: 0 0 16px;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-choice-title {
    display: block;
    font-size: 24px;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-choice-panel {
    padding: 0;
    border: 0;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-primary-grid,
html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-utility-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-action,
html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-utility-row .claim-entry-action {
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) 30px;
    grid-template-rows: 1fr;
    align-items: center;
    column-gap: 12px;
    padding: 0 18px;
    border-radius: 8px;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-action__top,
html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-action__icon,
html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-action__copy small {
    display: none;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-action__copy {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    margin-top: 0;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-action__arrow {
    grid-column: 2;
    grid-row: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f2f4f6;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-utility-row {
    margin-top: 10px;
    padding-top: 0;
    border-top: 0;
}

html[data-is-tablet-mode="mobile"] body.is-claim-entry-page .claim-entry-assurance {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding-top: 0;
    border-top: 0;
}

/* A PC claim DOM opened before rotation keeps its wizard and receives tablet-safe width. */
html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .hospital-document-ai-wrapper {
    padding: calc(var(--header-height, 45px) + 14px) 16px 0;
}

html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .hospital-document-ai-shell,
html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .claim-workspace-shell {
    width: min(720px, 100%);
    max-width: 100%;
}

html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .service-studio-topbar.us-hero-poster {
    min-height: 0;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 14px;
}

html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .ai-hub-services-bar {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
}

html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .claim-workspace-page {
    padding: 0 16px 56px;
}

html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .claim-workspace-head {
    top: var(--header-height, 45px);
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0;
}

html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .claim-workspace-steps {
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .form-grid,
html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .form-grid-3,
html[data-is-tablet-mode="mobile"] body.insurance-claim-page.claim-pc-wizard-enabled .form-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-is-tablet-mode="mobile"] .claim-quick-page:not(.claim-quick-page--mobile) {
    width: min(720px, calc(100% - 32px));
    margin-top: var(--header-height, 45px);
    padding: 18px 0 56px;
}

html[data-is-tablet-mode="mobile"] .claim-quick-page:not(.claim-quick-page--mobile) .claim-quick-titlebar {
    min-height: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
}

/* A mobile claim DOM opened in portrait remains active and uses landscape space. */
html[data-is-tablet-mode="desktop"] body.insurance-claim-page.claim-mobile-wizard-enabled .hospital-document-ai-wrapper {
    padding: calc(var(--header-height, 70px) + 18px) 24px 0;
}

html[data-is-tablet-mode="desktop"] body.insurance-claim-page.claim-mobile-wizard-enabled .hospital-document-ai-shell,
html[data-is-tablet-mode="desktop"] body.insurance-claim-page.claim-mobile-wizard-enabled .claim-workspace-shell {
    width: min(1180px, 100%);
    max-width: none;
    margin-right: auto;
    margin-left: auto;
}

html[data-is-tablet-mode="desktop"] body.insurance-claim-page.claim-mobile-wizard-enabled .claim-workspace-page {
    padding-right: 24px;
    padding-bottom: 56px;
    padding-left: 24px;
}

html[data-is-tablet-mode="desktop"] body.insurance-claim-page.claim-mobile-wizard-enabled .about-story-scene.is-mobile-active-step .about-story-scene__layout {
    width: min(920px, 100%);
    max-width: none;
    margin-right: auto;
    margin-left: auto;
}

html[data-is-tablet-mode="desktop"] body.insurance-claim-page.claim-mobile-wizard-enabled .form-grid,
html[data-is-tablet-mode="desktop"] body.insurance-claim-page.claim-mobile-wizard-enabled .form-grid-3,
html[data-is-tablet-mode="desktop"] body.insurance-claim-page.claim-mobile-wizard-enabled .form-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-is-tablet-mode="desktop"] .claim-quick-page--mobile {
    width: min(960px, calc(100% - 48px));
    margin-top: var(--header-height, 70px);
    padding: 18px 0 100px;
}

html[data-is-tablet-mode="desktop"] .claim-quick-page--mobile .claim-quick-grid--two,
html[data-is-tablet-mode="desktop"] .claim-quick-page--mobile .claim-quick-party-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
