/* Phone and tablet QA: keep controls readable without changing desktop composition. */
@media (max-width:1350px) {
 body.brand-tomiplan .navigation-2 .navigation-items {max-height:calc(100dvh - 112px);overscroll-behavior:contain}
}
/* Six long labels need three columns before the full desktop layout fits. */
@media (min-width:721px) and (max-width:1100px) {
 body.brand-tomiplan .private-process .step-tabs {grid-template-columns:repeat(3,minmax(0,1fr))}
 body.brand-tomiplan .private-process .step-tabs button {min-height:80px}
}
body.brand-tomiplan .private-process .step-tabs button {min-width:0;overflow-wrap:anywhere}
body.brand-tomiplan .private-process .step h3 {overflow-wrap:anywhere}
@media (max-width:720px) {
 body.brand-tomiplan .private-process .journey-controls {grid-template-columns:1fr auto 1fr;gap:8px}
 body.brand-tomiplan .private-process .journey-progress {display:contents}
 body.brand-tomiplan .private-process .step-dots {grid-column:1/-1;grid-row:1;width:100%;justify-content:center}
 body.brand-tomiplan .private-process .step-dots button {width:44px;height:44px;flex:0 1 44px;min-width:0}
 body.brand-tomiplan .private-process .progress-text {grid-column:2;grid-row:2;text-align:center;font-size:14px}
 body.brand-tomiplan .private-process .pager-back {grid-column:1;grid-row:2;min-width:64px}
 body.brand-tomiplan .private-process .pager-next {grid-column:3;grid-row:2;min-width:64px}
}
/* Keep the three benefits open and easy to scan on portrait tablets. */
@media (min-width:768px) and (max-width:991px) {
 body.home-navy .home-experience .experience-columns {grid-template-columns:1fr;gap:24px}
 body.home-navy .home-experience .experience-item {display:grid;grid-template-columns:32px minmax(0,1fr);column-gap:20px}
 body.home-navy .home-experience .experience-item svg {grid-column:1;grid-row:1/3;margin:0}
 body.home-navy .home-experience .experience-item h3 {min-height:0;max-width:none;margin-bottom:12px}
 body.home-navy .home-experience .experience-item p {grid-column:2}
 body.home-navy .home-experience .experience-item+article {border-left:0;border-top:1px solid #1b2a4a26;padding:24px 0 0}
}
@media (max-width:1024px) {
 body.brand-tomiplan .tp-modal-close {width:44px;height:44px}
 body.brand-tomiplan .services-sheet-toolbar button {min-height:44px}
}

/* Shared phone/tablet rhythm; the wide desktop composition stays unchanged. */
@media (max-width:1100px) {
 body.brand-tomiplan :is(.tp-shared-wrap,.contact-page-wrap,.private-process .wrap) {min-width:0}
 body.brand-tomiplan .tp-shared-contact-inner {flex-wrap:wrap}
 body.brand-tomiplan .navigation-2 .navigation-items {max-height:calc(100dvh - 112px);overscroll-behavior:contain}
 body.brand-tomiplan #tp-services {min-height:0;padding:32px 24px 48px}
 body.brand-tomiplan .tp-services-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:32px 20px;align-items:stretch}
 body.brand-tomiplan .tp-service {width:100%;min-width:0;height:100%;gap:14px;padding:20px 12px}
 body.brand-tomiplan .tp-service:last-child {grid-column:2}
 body.brand-tomiplan .tp-service-title {font-size:20px;line-height:1.4}
 body.brand-tomiplan :is(.tp-service-count,.brand-category-scope) {font-size:14px!important;line-height:1.5}
 body.brand-tomiplan .services-sheet {max-height:calc(100dvh - 32px);width:calc(100% - 32px)}
 body.brand-tomiplan .services-sheet-scroll {max-height:55dvh;overflow:auto;overscroll-behavior:contain;scrollbar-width:auto;border:1px solid #deded8}
 body.brand-tomiplan .services-sheet table {border:0}
 body.brand-tomiplan .services-sheet th {position:sticky;top:0;z-index:2}
 body.brand-tomiplan .services-sheet :is(th,td):first-child {position:sticky;left:0;z-index:1;background:#f7f4ed;box-shadow:2px 0 4px #1b2a4a12}
 body.brand-tomiplan .services-sheet th:first-child {z-index:3;background:#1b2a4a}
}
@media (max-width:991px) {
 body.contact-refreshed .contact-content {grid-template-columns:1fr;gap:36px;max-width:760px}
 body.contact-refreshed .contact-info-card {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 32px;min-width:0}
 body.contact-refreshed .contact-info-card>:is(.contact-kicker,h2) {grid-column:1/-1;margin:0}
 body.contact-refreshed .contact-info-group+.contact-info-group {margin:0;padding:0;border:0}
 body.home-navy .home-difference-wrap {grid-template-columns:1fr;gap:32px}
 body.home-navy .home-difference-image {height:auto;min-height:0;max-height:460px;aspect-ratio:16/10}
 body.brand-tomiplan .private-process .hero-inner {grid-template-columns:1fr;gap:28px;padding-block:40px}
 body.brand-tomiplan .private-process .hero-copy {padding:0;max-width:760px}
 body.brand-tomiplan .private-process .hero h1 {font-size:clamp(36px,6vw,56px)}
 body.brand-tomiplan .private-process .hero-lead {max-width:42rem}
 body.brand-tomiplan .private-process .hero-visual img {aspect-ratio:16/9;max-height:460px}
 body.brand-tomiplan .private-process .section-intro {grid-template-columns:1fr;gap:16px}
 body.brand-tomiplan .private-process .section-intro>p {max-width:44rem}
 body.brand-tomiplan .bio-modal-wrapper .bio-role {font-size:14px!important}
}
@media (max-width:767px) {
 body.brand-tomiplan #tp-services {padding:20px 20px 36px}
 body.brand-tomiplan .tp-services-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 12px;margin-top:0}
 body.brand-tomiplan .tp-service {padding:18px 8px;gap:12px}
 body.brand-tomiplan .tp-service:last-child {grid-column:1/-1;width:calc((100% - 12px)/2);justify-self:center}
 body.brand-tomiplan .tp-service-title {font-size:18px}
 body.brand-tomiplan .private-process .step h3 {font-size:clamp(25px,5vw,32px);line-height:1.2}
 body.home-refreshed.brand-tomiplan .who-we-are .paragraph-6 {font-size:16px}
 body.brand-tomiplan .services-sheet-page>header h2 {font-size:26px;line-height:1.25}
 body.brand-tomiplan .services-sheet-toolbar button {font-size:14px;min-height:44px}
 body.brand-tomiplan .tp-shared-disclosures a {min-height:44px;padding-block:10px;box-sizing:border-box}
 body.contact-refreshed .contact-info-card {gap:22px}
 body.brand-tomiplan :is(.bio-fact strong,.shared-professionals strong,.shared-professionals span) {font-size:14px}
}
@media (max-width:600px) {
 body.brand-tomiplan {padding-top:90px!important}
 body.brand-tomiplan .navigation-2,body.brand-tomiplan .navigation-wrap-2 {height:90px}
 body.brand-tomiplan .logo-link-2 {width:180px;height:90px;min-width:0}
 body.brand-tomiplan .logo-image-2 {width:180px!important;height:90px!important}
 body.brand-tomiplan .navigation-2 .navigation-items {max-height:calc(100dvh - 90px)}
 body.brand-tomiplan .heading-jumbo-copy {width:100%;max-width:32ch;padding:24px!important;font-size:clamp(28px,6vw,34px)!important;line-height:1.3!important}
 body.home-navy .home-static-hero {height:clamp(420px,70svh,580px);min-height:0}
 body.brand-tomiplan .private-process .hero h1 {font-size:clamp(34px,9vw,48px);line-height:1.1}
 body.brand-tomiplan .private-process .hero-visual img {aspect-ratio:4/3}
 body.brand-tomiplan .private-process section[id] {scroll-margin-top:110px}
 body.brand-tomiplan .private-process .section-intro h2 {font-size:clamp(30px,8vw,40px)}
 body.contact-refreshed .contact-info-card {grid-template-columns:1fr}
 body.contact-refreshed .contact-content {scroll-margin-top:110px}
 body.brand-tomiplan .home-difference-image {aspect-ratio:4/3}
}
/* Keep service content scrollable and the close control outside that scroll area. */
body.brand-tomiplan .tp-modal {padding:16px;box-sizing:border-box}
body.brand-tomiplan .tp-modal-card {display:flex;flex-direction:column;max-height:calc(100dvh - 32px);overflow:hidden;padding:0}
body.brand-tomiplan .tp-modal-close {position:relative;top:auto;right:auto;align-self:flex-end;flex:0 0 44px;width:44px;height:44px;margin:12px 12px 0;z-index:2}
body.brand-tomiplan .tp-modal-content {overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:0 36px 30px}
body.brand-tomiplan .tp-modal-title {padding-right:0}
@media(max-width:600px) {
 body.brand-tomiplan .tp-modal-content {padding:0 24px 24px}
 body.brand-tomiplan .tp-modal-title {font-size:26px;line-height:1.25}
 body.brand-tomiplan .tp-modal-list li {font-size:16px;line-height:1.6}
 body.brand-tomiplan .tp-modal-subtitle {font-size:13px}
}
@media(max-height:520px) {
 body.brand-tomiplan .tp-modal {padding:10px}
 body.brand-tomiplan .tp-modal-card {max-height:calc(100dvh - 20px)}
 body.brand-tomiplan .bio-modal-wrapper {padding:10px!important}
 body.brand-tomiplan .bio-modal-wrapper .bio-panel {max-height:calc(100dvh - 20px)!important}
}
@media (prefers-reduced-motion:reduce) {
 body.brand-tomiplan :is(.tp-modal,.tp-modal-card) {transition:none}
}
/* Match both bio scroll layers so no biography is clipped below the frame. */
body.brand-tomiplan .bio-modal-wrapper .bio-popup-container {height:auto!important;max-height:calc(100dvh - 64px)!important;min-height:0!important;box-sizing:border-box}
body.brand-tomiplan .bio-modal-wrapper .bio-panel {max-height:calc(100dvh - 66px)!important;min-height:0!important;box-sizing:border-box}
@media(max-width:820px) {
 body.brand-tomiplan .bio-modal-wrapper .bio-popup-container {max-height:calc(100dvh - 32px)!important}
 body.brand-tomiplan .bio-modal-wrapper .bio-panel {max-height:calc(100dvh - 34px)!important}
}
@media(max-height:520px) {
 body.brand-tomiplan .bio-modal-wrapper .bio-popup-container {max-height:calc(100dvh - 20px)!important}
 body.brand-tomiplan .bio-modal-wrapper .bio-panel {max-height:calc(100dvh - 22px)!important}
}
@media print {
 body.brand-tomiplan .services-sheet-scroll {max-height:none!important;overflow:visible!important;border:0}
 body.brand-tomiplan .services-sheet :is(th,td) {position:static!important;box-shadow:none}
}
