/* Final overrides for the existing components; service order is unchanged. */
#root .customer-home #free-services-carousel .service-banner>img{object-fit:contain!important;object-position:center!important}
#root .customer-home .service-banner-copy{left:auto;right:auto;inset-inline-start:5%;inset-inline-end:auto;text-align:start;min-width:0;box-sizing:border-box;padding-block:8px;max-height:100%;gap:clamp(3px,1vw,8px)}
#root .customer-home .service-banner-copy b{white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.3;font-size:clamp(14px,2.4vw,26px)}
#root .customer-home .service-banner-copy small,#root .customer-home .service-banner-copy>span{white-space:normal;line-height:1.35;font-size:clamp(10px,1.25vw,15px)}
html[dir=ltr] #root .customer-home .service-banner::after{background:linear-gradient(90deg,#032f37e8 0%,#032f3799 35%,transparent 72%)}
#root .service-page-header{display:flex;align-items:center;gap:12px}
#root .service-page-header>div,#root .service-page label,#root .professional-card{min-width:0;overflow-wrap:anywhere}
#root .service-page label{text-align:start;line-height:1.5}
#root .service-page input,#root .service-page select,#root .service-page textarea{min-width:0;max-width:100%;box-sizing:border-box}
#root .service-page .doctor-photo img,#root .service-page img.doctor-photo,#root .service-page .medical-avatar img{object-fit:contain;width:100%;height:100%;max-width:100%;aspect-ratio:1}
#root .service-page .doctor-summary{min-width:0;flex:1}
#root .service-page .community-toolbar{display:flex;flex-wrap:wrap;gap:10px}
@media(min-width:700px){
 #root .services-professional{width:100%;max-width:1180px;margin-inline:auto}
 #root .services-professional .app-content{max-width:none;width:100%;box-sizing:border-box}
 #root .service-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
 #root .customer-home #free-services-carousel .service-banner{min-height:190px;max-height:360px}
 #root .customer-home .categories{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
 #root .service-page .service-form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
}
@media(min-width:1100px){#root .service-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:699px){#root .service-card-grid{grid-template-columns:minmax(0,1fr)}#root .customer-home .service-banner-copy{width:57%}}

/* Tablet home uses the viewport, not the legacy 940px shell / 600px grid.
   Keep phone rules intact and retain the existing artwork and service order. */
@media (min-width:700px) {
 body.customer-theme #root > .phone-shell.customer-home {
  width:100%;max-width:none;margin-inline:0;box-sizing:border-box;
 }
 body.customer-theme #root > .customer-home > .app-content {
  width:100%;max-width:none;box-sizing:border-box;
  padding-inline:max(20px,env(safe-area-inset-left)) max(20px,env(safe-area-inset-right));
 }
 body.customer-theme #root .customer-home .service-filter .categories,
 body.customer-theme #root .customer-home .theme-home-stats,
 body.customer-theme #root .customer-home .app-content > [data-ad-slot],
 body.customer-theme #root .customer-home #home-ad-carousel,
 body.customer-theme #root .customer-home #free-services-carousel {
  width:100%;max-width:none;margin-inline:0;box-sizing:border-box;
 }
 body.customer-theme #root .customer-home .service-filter .categories {
  grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;
 }
 body.customer-theme #root .customer-home .theme-service-scene {
  max-height:none;aspect-ratio:auto;
 }
 body.customer-theme #root .customer-home .categories .service-copy {
  min-height:46%;padding:24px 8px 12px;box-sizing:border-box;
 }
 body.customer-theme #root .customer-home .categories .service-copy b {
  font-size:clamp(17px,1.7vw,23px);line-height:1.5;overflow-wrap:anywhere;
 }
 body.customer-theme #root .customer-home #free-services-carousel .ad-slides {
  height:96px;min-height:0;aspect-ratio:auto;
 }
 body.customer-theme #root .customer-home #free-services-carousel .service-banner {
  height:100%;min-height:0;max-height:none;aspect-ratio:auto;
 }
 body.customer-theme #root .customer-home .theme-home-stats > div,
 body.customer-theme #root .customer-home .theme-home-stats strong {font-size:16px;}
 body.customer-theme #root .customer-home nav.sahla-bottom-nav {
  width:calc(100% - 40px);max-width:none;
 }
 body.customer-theme #root .customer-home nav.sahla-bottom-nav button {font-size:14px;}
}

/* Closed history rows stay compact; native details supports touch and keyboard. */
#root .customer-order-group {margin-block:16px 24px;}
#root .customer-order-group > h2 {font-size:1.1rem;margin-block:0 12px;}
#root .previous-order {margin-block:8px;border:1px solid #d3e3db;border-radius:12px;background:#fff;color:#17352d;overflow:hidden;}
#root .previous-order > summary {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;cursor:pointer;list-style:none;}
#root .previous-order > summary::-webkit-details-marker {display:none;}
#root .previous-order > summary:focus-visible {outline:3px solid #08704b;outline-offset:-3px;}
#root .previous-order-title,#root .previous-order-meta {display:flex;flex-direction:column;gap:4px;min-width:0;overflow-wrap:anywhere;}
#root .previous-order-title {flex:1;}
#root .previous-order-meta {align-items:flex-end;text-align:end;}
#root .previous-order summary b {font-size:.9rem;line-height:1.4;}
#root .previous-order summary small {font-size:.75rem;line-height:1.4;color:#526c60;}
#root .previous-order summary .status {font-size:.75rem;padding:3px 8px;}
#root .previous-order-details {border-top:1px solid #e3eee8;padding:8px;}
#root .previous-order-details > .order-card {margin:0;box-shadow:none;}
#root .orders-empty-inline {padding:12px;margin:0;color:#526c60;}
#root .orders-view-toggle {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-block:12px 18px;}
#root .orders-view-toggle button {min-width:0;min-height:44px;padding:8px;font-size:14px;white-space:normal;}
#root .orders-view-toggle button[aria-pressed=true] {background:#086547;color:#fff;}


/* Service pages use the viewport; preserve the existing cards and grids. */
body.customer-theme #root > .phone-shell.service-fullscreen{max-width:none;width:100%;margin:0;min-height:100dvh;}
body.customer-theme #root > .service-fullscreen > .app-content{max-width:none;width:100%;min-height:0;border-radius:0;padding-top:0;overflow:visible;box-sizing:border-box;}
body.customer-theme #root .service-fullscreen .theme-catalog-panel{max-width:none;margin:0;min-height:0;}
#root .service-navigation{min-height:44px;padding:env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));}
#root .service-fullscreen .app-content{padding-bottom:calc(94px + env(safe-area-inset-bottom));}
#root .service-fullscreen h1,#root .service-fullscreen h2,#root .service-fullscreen button{overflow-wrap:anywhere;min-width:0;}

.catalog-skeleton{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;pointer-events:none}.catalog-skeleton>div{height:120px;border-radius:12px;background:#e4ece8;padding:12px}.catalog-skeleton i,.catalog-skeleton span{display:block;background:#d3dfd8;border-radius:6px;height:64px}.catalog-skeleton span{height:12px;width:65%;margin-top:10px}

/* Remove outer service gutters only; product cards and their grids are unchanged. */
body.customer-theme.service-viewport{padding:0;}
body.customer-theme #root>.phone-shell.service-fullscreen{overflow:visible;min-height:100dvh;}
body.customer-theme #root>.phone-shell.service-fullscreen>.app-content{max-width:none;margin:0;padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right));border-radius:0;min-height:calc(100dvh - 44px - env(safe-area-inset-top));}
body.customer-theme #root>.customer-home.service-fullscreen>.app-content{padding-inline:0;}
body.customer-theme #root .customer-home.service-fullscreen .home-discovery.theme-catalog-panel{margin:0;border-radius:0;padding:8px max(8px,env(safe-area-inset-right)) 8px max(8px,env(safe-area-inset-left));min-height:calc(100dvh - 138px - env(safe-area-inset-top) - env(safe-area-inset-bottom));}
body.customer-theme #root .service-fullscreen>.service-page-header{min-height:44px;height:auto;margin:0;padding:env(safe-area-inset-top) max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left));gap:8px;}
body.customer-theme #root .service-fullscreen>.service-page-header h1{margin-block:4px;}
body.customer-theme #root .service-fullscreen>.service-page-header p{margin-block:0 4px;}
body.customer-theme #root .service-fullscreen>.service-page-header small{display:none;}
body.customer-theme #root .service-fullscreen .service-page>.form-card{margin:0;width:100%;max-width:none;}
body.customer-theme #root>.search-page.service-fullscreen>.app-content{padding-top:env(safe-area-inset-top);min-height:100dvh;}
body.customer-theme #root .service-fullscreen .search-page-head{top:0;}


/* Compact doctor directory on phones and tablets. */
#root .medical-directory .service-card-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:8px;align-items:start}
#root .medical-directory .professional-card{display:grid;grid-template-columns:52px minmax(0,1fr);gap:4px 10px;padding:10px;align-content:start}
#root .medical-directory .professional-card>*{grid-column:2;margin:0;min-width:0}
#root .medical-directory .professional-card>img.doctor-photo,#root .medical-directory .professional-card>.medical-avatar{grid-column:1;grid-row:1 / span 3;width:52px;height:52px;max-width:52px;aspect-ratio:1;object-fit:contain;border-radius:8px}
#root .medical-directory .professional-card h3{font-size:15px;line-height:1.4}
#root .medical-directory .professional-card p,#root .medical-directory .professional-card small{font-size:12px;line-height:1.4}
#root .medical-directory .professional-card a,#root .medical-directory .professional-card button{min-height:36px;padding:5px;font-size:13px}
#root .medical-directory .professional-card .service-contact-links{display:flex;flex-wrap:wrap;gap:5px}
.checkout-vehicle-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:8px}
.checkout-vehicle-options button{display:grid;place-items:center;gap:4px;min-width:0;min-height:64px;padding:7px 3px;border:1px solid #cadbd3;border-radius:9px;background:#fff;color:#164f3e;font-size:12px}
.checkout-vehicle-options button[aria-pressed=true]{background:#e0f4e9;border:2px solid #08704b}
.checkout-vehicle-options svg{width:34px;height:28px;fill:none;stroke:currentColor;stroke-width:1.6}

#root .medical-directory .service-card-grid{display:grid;grid-template-columns:1fr;gap:6px}
#root .medical-row{display:flex;align-items:flex-start;gap:9px;min-width:0;padding:9px;background:#fff;border:1px solid #dce8e1;border-radius:9px;box-sizing:border-box}
#root .medical-row-photo{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;object-fit:contain;border-radius:7px;background:#f0f7f3;font-size:22px}
#root .medical-row-body{min-width:0;flex:1}#root .medical-row h3{font-size:14px;line-height:1.4;margin:0 0 3px}
#root .medical-row p{font-size:12px;line-height:1.4;margin:2px 0;color:#52695e;overflow-wrap:anywhere}
#root .medical-row-actions,#root .medical-row-actions .service-contact-links{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:3px 0 0}
#root .medical-row-actions a,#root .medical-row-actions button{display:inline-flex;align-items:center;min-height:32px;width:auto;margin:0;padding:4px 7px;font-size:12px;line-height:1.3;border-radius:6px}
#root .medical-row-actions button{border:1px solid #c6dfd2;background:#edf7f1;color:#086340}#root .medical-row-actions button:disabled{color:#7d8882;background:#f5f6f5;border-color:#e1e5e2}
@media(min-width:900px){#root .medical-directory .service-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

#root .medical-directory .directory-city-select{display:flex;align-items:center;gap:10px;margin:8px 0;font-size:13px}#root .medical-directory .directory-city-select select{flex:1;min-width:0;min-height:44px;padding:8px 12px;border:1px solid #d4e4db;border-radius:12px;background:#fff;font:inherit;color:#174d3b}#root .medical-directory .service-specialty-tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;gap:8px;padding:8px 0 12px;scrollbar-width:thin}#root .medical-directory .service-specialty-tabs button{flex:0 0 auto;min-height:40px;max-width:220px;padding:8px 14px;border-radius:20px;font-size:13px;white-space:nowrap}#root .medical-directory .service-card-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:10px}#root .medical-row{padding:12px;border-radius:14px;gap:12px}#root .medical-row-photo{width:44px;height:44px;flex-basis:44px}#root .medical-row h3{font-size:16px}#root .medical-row p{font-size:13px;line-height:1.6}#root .medical-row-actions a,#root .medical-row-actions button{min-height:40px;padding:7px 10px}
