/* ======================================================================
   iTeachPlus V4.38.1 — Teacher Profile Responsive / Commerce / Pro fix
   Loaded after V4.37.1 + V4.38 review styles.
   ====================================================================== */
.teacher-hero-v4381,.teacher-page-v4381{overflow-x:hidden;overflow:clip}
.teacher-hero-v4381 *,.teacher-page-v4381 *,.teacher-mobile-cta-v4381 *{box-sizing:border-box}
.teacher-page-v4381 img,.teacher-hero-v4381 img{max-width:100%}
.teacher-main-v437,.teacher-main-v437>.teacher-module-v436,.teacher-module-v436>*,.teacher-course-card-v437>*,.teacher-related-card-v437>*,.teacher-reviews-layout-v438>*{min-width:0}
.teacher-module-v436[id]{scroll-margin-top:110px}

/* Pro presentation */
.teacher-hero-topline-v4381{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.teacher-pro-badge-v4381{display:inline-flex;align-items:center;gap:6px;min-height:38px;padding:0 12px;border:1px solid rgba(148,190,187,.52);border-radius:999px;background:rgba(148,190,187,.14);color:#dff8f4;font-size:.58rem;font-weight:950;backdrop-filter:blur(12px)}
.teacher-pro-badge-v4381 svg{width:14px;height:14px;color:#F4D892}
.teacher-pro-strip-v4381{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin-top:12px;padding:9px 11px;border:1px solid rgba(255,255,255,.14);border-radius:14px;background:rgba(10,32,39,.28);color:rgba(255,255,255,.78);backdrop-filter:blur(10px)}
.teacher-pro-strip-v4381>span{display:inline-flex;align-items:center;gap:6px;color:#fff;font-size:.54rem}.teacher-pro-strip-v4381>span svg{width:14px;color:#F4D892}.teacher-pro-strip-v4381 small{padding:4px 7px;border-radius:999px;background:rgba(255,255,255,.08);font-size:.47rem;line-height:1.45}

/* Commerce */
.teacher-course-commerce-v4381 del{color:#9aa5a9;font-size:.51rem;text-decoration-thickness:1px}
.teacher-course-copy-v437 div{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.teacher-course-copy-v437 div .teacher-commerce-chip-v4381{display:inline-flex;align-items:center;gap:4px;padding:4px 7px;border-radius:999px;background:rgba(244,216,146,.26);color:#8a6818;font-size:.47rem}.teacher-commerce-chip-v4381 svg{width:11px;height:11px}
.teacher-price-old-v4381{margin-top:4px;color:#9aa5a9;font-size:.51rem}
.teacher-price-badge-v4381{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;margin-top:7px;padding:5px 7px;border-radius:999px;background:rgba(148,190,187,.16);color:#41676f;font-size:.47rem;font-weight:900}.teacher-price-badge-v4381 svg{width:11px;height:11px}

/* Calendar */
.teacher-booking-meta-v4381{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:-3px 0 15px}
.teacher-booking-meta-v4381>span{display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;column-gap:8px;align-items:center;padding:10px 11px;border:1px solid rgba(35,97,126,.07);border-radius:14px;background:rgba(255,255,255,.78)}
.teacher-booking-meta-v4381 svg{grid-row:1/3;width:32px;height:32px;padding:8px;border-radius:11px;background:rgba(148,190,187,.16);color:#23617E}.teacher-booking-meta-v4381 b{color:#173C4D;font-size:.56rem}.teacher-booking-meta-v4381 small{color:#829097;font-size:.47rem;line-height:1.45}
.teacher-booking-help-v4381{display:flex;align-items:flex-start;gap:6px;margin:11px 0 0;color:#7b8b91;font-size:.51rem;line-height:1.75}.teacher-booking-help-v4381 svg{width:14px;flex:0 0 auto;margin-top:2px;color:#23617E}

/* Related: six results, not three */
.teacher-related-v4381 .teacher-related-grid-v437{grid-template-columns:repeat(3,minmax(0,1fr))}

/* Desktop/tablet hardening */
@media(max-width:1180px){
  .teacher-page-grid-v437{width:100%;max-width:100%;padding-inline:clamp(16px,3vw,30px)}
  .teacher-course-card-v437{grid-template-columns:50px minmax(0,1fr) minmax(120px,auto)}
  .teacher-related-v4381 .teacher-related-grid-v437{grid-template-columns:repeat(2,minmax(0,1fr))}
  .teacher-booking-meta-v4381{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:900px){
  .teacher-page-grid-v437{padding-inline:16px}
  .teacher-main-v437{gap:14px}
  .teacher-main-v437 .teacher-module-v436{padding:20px;border-radius:24px}
  .teacher-course-grid-v437{grid-template-columns:1fr}
  .teacher-pricing-faq-grid-v437{grid-template-columns:1fr}
  .teacher-pricing-cards-v437{grid-template-columns:repeat(3,minmax(0,1fr))}
  .teacher-related-v4381 .teacher-related-grid-v437{grid-template-columns:repeat(2,minmax(0,1fr))}
  .teacher-booking-meta-v4381{grid-template-columns:1fr 1fr}.teacher-booking-meta-v4381>span:last-child{grid-column:1/-1}
}

/* ----------------------------------------------------------------------
   Mobile-first repair. This intentionally overrides V4.37.1's fixed-ish
   hero spacing and all carousel widths that could exceed small viewports.
   ---------------------------------------------------------------------- */
@media(max-width:767px){
  .teacher-module-v436[id]{scroll-margin-top:82px}

  /* Hero: full-screen feel, but content height is intrinsic and never clips. */
  .teacher-hero-v4381{margin-top:var(--teacher-header-overlap,0px)!important;padding:0!important;overflow:hidden}
  .teacher-hero-v4381 .teacher-hero-wrap-v437{width:100%!important;max-width:none!important;padding:0!important}
  .teacher-hero-v4381 .teacher-hero-shell-v437{position:relative;display:block;width:100%;min-height:max(680px,calc(100svh - var(--teacher-header-height,72px)));height:auto;border:0!important;border-radius:0!important;overflow:hidden;background:#112f3a}
  .teacher-hero-v4381 .teacher-hero-photo-v437{position:absolute;inset:0;width:100%;height:100%;min-height:100%;aspect-ratio:auto}
  .teacher-hero-v4381 .teacher-hero-photo-v437 img{width:100%;height:100%;object-fit:cover;object-position:var(--teacher-mobile-object-position,center top);transform:none}
  .teacher-hero-v4381 .teacher-hero-overlay-v437{position:absolute;inset:0;background:linear-gradient(180deg,rgba(6,24,31,.06) 0%,rgba(6,24,31,.10) 24%,rgba(6,24,31,.52) 47%,rgba(5,22,29,.94) 68%,#081f28 100%),linear-gradient(90deg,rgba(7,29,36,.08),rgba(7,29,36,.32))}
  .teacher-hero-v4381 .teacher-hero-content-v437{position:relative;z-index:2;display:flex;width:100%!important;max-width:none;min-height:max(680px,calc(100svh - var(--teacher-header-height,72px)));height:auto;margin:0!important;padding:clamp(225px,40svh,350px) 16px 36px!important;justify-content:flex-end;align-items:stretch;text-align:right}
  .teacher-hero-topline-v4381{gap:6px}
  .teacher-hero-v4381 .teacher-hero-kicker-v437,.teacher-pro-badge-v4381{min-height:32px;padding-inline:9px;font-size:.52rem}
  .teacher-hero-v4381 .teacher-hero-content-v437 h1{width:100%;max-width:100%;margin:12px 0 0;font-size:clamp(1.65rem,8.2vw,2.35rem);line-height:1.34;letter-spacing:-.015em;text-wrap:pretty;overflow-wrap:anywhere}
  .teacher-hero-v4381 .teacher-hero-lead-v437{width:100%;max-width:100%;margin-top:10px;font-size:.64rem;line-height:1.85;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .teacher-hero-v4381 .teacher-hero-identity-v437{margin-top:12px}.teacher-hero-v4381 .teacher-hero-name-v437{flex-wrap:wrap}.teacher-hero-v4381 .teacher-hero-name-v437 strong{font-size:.95rem;overflow-wrap:anywhere}.teacher-hero-v4381 .teacher-hero-identity-v437 p{font-size:.56rem;line-height:1.7}
  .teacher-hero-v4381 .teacher-hero-proof-v437{display:flex;max-width:100%;gap:5px;margin-top:12px}.teacher-hero-v4381 .teacher-hero-proof-v437 span{min-height:31px;max-width:100%;padding:0 8px;border-radius:10px;font-size:.48rem;white-space:normal}.teacher-hero-v4381 .teacher-hero-proof-v437 svg{width:13px;height:13px;flex:0 0 auto}
  .teacher-hero-v4381 .teacher-hero-actions-v437{display:grid!important;grid-template-columns:1fr 1fr;width:100%;gap:7px;margin-top:14px}.teacher-hero-v4381 .teacher-primary-cta-v437,.teacher-hero-v4381 .teacher-secondary-cta-v437{width:100%;min-width:0;min-height:46px;padding:0 9px;font-size:.56rem;text-align:center;line-height:1.45}.teacher-hero-v4381 .teacher-icon-cta-v437{grid-column:1/-1;width:100%;height:42px;min-height:42px}
  .teacher-hero-v4381 .teacher-hero-price-v437{gap:6px;margin-top:10px;font-size:.54rem;line-height:1.6}.teacher-hero-v4381 .teacher-hero-price-v437 strong{font-size:.64rem}
  .teacher-pro-strip-v4381{display:grid;grid-template-columns:1fr;gap:5px;margin-top:9px;padding:8px 9px}.teacher-pro-strip-v4381>span{font-size:.51rem}.teacher-pro-strip-v4381 small{width:max-content;max-width:100%;font-size:.45rem}
  .teacher-hero-sidequote-v437{display:none!important}

  /* Main page */
  .teacher-page-v4381{padding:10px 0 calc(154px + env(safe-area-inset-bottom,0px))!important;overflow:hidden}
  .teacher-page-v4381 .teacher-page-grid-v437{width:100%;max-width:100%;padding-inline:10px!important}
  .teacher-page-v4381 .teacher-main-v437{display:grid;gap:10px}
  .teacher-page-v4381 .teacher-main-v437 .teacher-module-v436{width:100%;max-width:100%;margin:0;padding:15px!important;border-radius:20px;overflow:hidden}
  .teacher-page-v4381 .teacher-module-head-v437{display:grid!important;grid-template-columns:minmax(0,1fr);gap:8px;margin-bottom:14px}.teacher-page-v4381 .teacher-module-head-v437>div{min-width:0}.teacher-page-v4381 .teacher-module-head-v437 h2{font-size:.9rem;line-height:1.6;overflow-wrap:anywhere}.teacher-page-v4381 .teacher-module-head-v437 p{font-size:.55rem;line-height:1.75}.teacher-page-v4381 .teacher-section-link-v437{justify-self:start;max-width:100%;min-height:36px;white-space:normal;text-align:center}

  /* About */
  .teacher-about-v437{padding:10px!important}.teacher-about-grid-v437{grid-template-columns:1fr;gap:15px}.teacher-about-media-v437{min-height:0;aspect-ratio:4/3;border-radius:16px}.teacher-about-copy-v437>p{font-size:.62rem;line-height:1.95;overflow-wrap:anywhere}.teacher-about-stats-v437{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.teacher-about-stats-v437 article{min-width:0;padding:11px 6px}.teacher-about-stats-v437 strong{max-width:100%;font-size:.59rem;overflow-wrap:anywhere}.teacher-about-stats-v437 span{font-size:.46rem}

  /* Expertise + style */
  .teacher-expertise-chips-v437{gap:6px}.teacher-expertise-chips-v437 span{min-height:34px;max-width:100%;padding:0 9px;font-size:.51rem;white-space:normal;overflow-wrap:anywhere}
  .teacher-style-grid-v437{grid-template-columns:1fr;gap:7px}.teacher-style-grid-v437 article{grid-template-columns:40px minmax(0,1fr);gap:9px;padding:11px}.teacher-style-grid-v437 article>svg{width:40px;height:40px;padding:10px}.teacher-style-grid-v437 p{font-size:.52rem;line-height:1.72}

  /* Courses: no horizontal overflow; price/action move below copy. */
  .teacher-course-grid-v437{grid-template-columns:1fr;gap:8px}.teacher-course-card-v437{grid-template-columns:42px minmax(0,1fr);gap:10px;width:100%;padding:12px}.teacher-course-icon-v437{width:42px;height:42px}.teacher-course-commerce-v437{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;align-items:center;justify-items:start;gap:5px 8px;width:100%;min-width:0;padding-top:10px;border-top:1px solid rgba(35,97,126,.07)}.teacher-course-commerce-v437 del{grid-column:1;font-size:.47rem}.teacher-course-commerce-v437 strong{grid-column:1;font-size:.64rem}.teacher-course-commerce-v437 a{grid-column:2;grid-row:1/3;justify-self:end;max-width:100%;min-height:38px;padding-inline:10px;text-align:center}.teacher-course-copy-v437 h3{font-size:.67rem;overflow-wrap:anywhere}.teacher-course-copy-v437 p{font-size:.52rem}.teacher-course-copy-v437 div .teacher-commerce-chip-v4381{font-size:.44rem}

  /* Calendar: responsive two-column slots instead of 44vw carousel. */
  .teacher-booking-meta-v4381{grid-template-columns:1fr;gap:6px;margin-bottom:12px}.teacher-booking-meta-v4381>span,.teacher-booking-meta-v4381>span:last-child{grid-column:auto;padding:9px}.teacher-booking-meta-v4381 b{font-size:.53rem}.teacher-booking-meta-v4381 small{font-size:.44rem}
  .teacher-slot-grid-v437{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;overflow:visible!important;margin:0!important;padding:0!important;scroll-snap-type:none!important}.teacher-slot-card-v437{width:auto!important;max-width:none!important;min-width:0!important;flex:auto!important}.teacher-slot-card-v437>span{min-height:96px;padding:10px;border-radius:14px}.teacher-slot-card-v437 small{font-size:.48rem}.teacher-slot-card-v437 strong{font-size:.55rem;overflow-wrap:anywhere}.teacher-slot-card-v437 b{font-size:.44rem}
  .teacher-booking-actions-v437{display:grid!important;grid-template-columns:1fr!important;gap:7px;margin-top:11px}.teacher-booking-actions-v437>button{width:100%;min-height:46px}.teacher-weekly-inline-v437{display:grid!important;grid-template-columns:88px minmax(0,1fr)!important;gap:7px;width:100%;margin:0!important}.teacher-weekly-inline-v437 select,.teacher-weekly-inline-v437 button{width:100%;min-width:0}.teacher-booking-help-v4381{font-size:.47rem}

  /* Reviews */
  .teacher-reviews-layout-v438{grid-template-columns:1fr!important;gap:12px}.teacher-review-list-v438{grid-template-columns:1fr!important}.teacher-review-form-shell-v438{position:static!important;min-width:0}.teacher-review-card-v438,.teacher-review-form-v438,.teacher-review-disabled-v438,.teacher-review-login-v438{width:100%;max-width:100%;padding:14px;border-radius:18px}.teacher-review-two-v438{grid-template-columns:1fr!important}.teacher-review-security-v438{grid-template-columns:1fr!important}.teacher-review-security-v438 label{justify-content:space-between}.teacher-review-security-v438 input{max-width:76px}.teacher-review-score-v437{justify-self:start}

  /* Pricing: stack cards; horizontal carousel removed. */
  .teacher-pricing-faq-grid-v437{grid-template-columns:1fr;gap:16px}.teacher-pricing-cards-v437{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;overflow:visible!important;margin:0!important;padding:4px 0!important;scroll-snap-type:none!important}.teacher-pricing-cards-v437 article{width:100%!important;max-width:none!important;min-height:0!important;flex:none!important;padding:14px;scroll-snap-align:none!important}.teacher-pricing-cards-v437 article>em{top:9px}.teacher-pricing-cards-v437 p{font-size:.51rem}.teacher-faq-v437 summary{font-size:.56rem;line-height:1.65}.teacher-faq-v437 details p{font-size:.51rem}

  /* Related teachers */
  .teacher-related-v4381 .teacher-related-grid-v437{grid-template-columns:1fr!important;gap:7px}.teacher-related-card-v437{grid-template-columns:64px minmax(0,1fr) 20px!important;gap:9px;width:100%;padding:9px}.teacher-related-card-v437>img{width:64px!important;height:72px!important}.teacher-related-card-v437 strong,.teacher-related-card-v437 small,.teacher-related-card-v437 p{overflow-wrap:anywhere}.teacher-related-card-v437>svg{width:16px}

  /* Fixed CTA: safe around iOS + app bottom nav, without covering content. */
  .teacher-mobile-cta-v4381{right:10px!important;left:10px!important;bottom:calc(72px + env(safe-area-inset-bottom,0px))!important;z-index:96!important;display:grid!important;grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr)!important;gap:8px!important;width:auto!important;max-width:calc(100vw - 20px)!important;padding:9px 10px!important;border-radius:17px!important}.teacher-mobile-cta-v4381>div{min-width:0}.teacher-mobile-cta-v4381 small{font-size:.45rem}.teacher-mobile-cta-v4381 strong{font-size:.62rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.teacher-mobile-cta-v4381>a{min-width:0;min-height:42px;padding:0 8px;font-size:.56rem;white-space:normal;text-align:center;line-height:1.45}
}

@media(max-width:430px){
  .teacher-hero-v4381 .teacher-hero-content-v437{padding-top:clamp(210px,37svh,315px)!important;padding-inline:14px!important}
  .teacher-hero-v4381 .teacher-hero-actions-v437{grid-template-columns:1fr!important}.teacher-hero-v4381 .teacher-icon-cta-v437{grid-column:auto!important}
  .teacher-page-v4381 .teacher-page-grid-v437{padding-inline:8px!important}.teacher-page-v4381 .teacher-main-v437 .teacher-module-v436{padding:13px!important;border-radius:18px}
  .teacher-slot-card-v437>span{min-height:92px;padding:9px}
  .teacher-mobile-cta-v4381{right:8px!important;left:8px!important;max-width:calc(100vw - 16px)!important}
}

@media(max-width:360px){
  .teacher-hero-v4381 .teacher-hero-content-v437{padding-top:205px!important;padding-inline:12px!important}.teacher-hero-v4381 .teacher-hero-content-v437 h1{font-size:1.55rem}.teacher-hero-v4381 .teacher-hero-proof-v437 span{font-size:.45rem}
  .teacher-slot-grid-v437{grid-template-columns:1fr!important}.teacher-slot-card-v437>span{min-height:82px}
  .teacher-weekly-inline-v437{grid-template-columns:1fr!important}
  .teacher-course-card-v437{grid-template-columns:38px minmax(0,1fr)}.teacher-course-icon-v437{width:38px;height:38px}.teacher-course-commerce-v437{grid-template-columns:1fr}.teacher-course-commerce-v437 a{grid-column:1;grid-row:auto;justify-self:stretch;justify-content:center;width:100%}
  .teacher-mobile-cta-v4381{grid-template-columns:.72fr 1.28fr!important;padding:8px!important}.teacher-mobile-cta-v4381>a{font-size:.52rem}
}

/* Dark-mode additions */
html[data-theme="dark"] .teacher-booking-meta-v4381>span,body.theme-dark .teacher-booking-meta-v4381>span{background:#173743;border-color:rgba(255,255,255,.07)}
html[data-theme="dark"] .teacher-booking-meta-v4381 b,body.theme-dark .teacher-booking-meta-v4381 b{color:#f1f5f5}
html[data-theme="dark"] .teacher-price-badge-v4381,body.theme-dark .teacher-price-badge-v4381,html[data-theme="dark"] .teacher-commerce-chip-v4381,body.theme-dark .teacher-commerce-chip-v4381{background:rgba(244,216,146,.10);color:#f4d892}

@media(prefers-reduced-motion:reduce){.teacher-hero-v4381 *,.teacher-page-v4381 *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
