.teacher-mobile-summary,.teacher-profile-toggle{display:none;}
.teacher-full-profile[hidden]{display:none;}
@media(min-width:0px){
.teacher-grid.wrap{gap:12px;}
.teacher-card.compact-teacher-ready{padding:18px;gap:0;border-radius:16px;text-align:left;}
.compact-teacher-ready h2{order:0;font-size:21px;line-height:1.25;margin:0 0 10px;text-align:left;}
.compact-teacher-ready .teacher-top{order:1;margin:0 0 10px;display:block;}
.compact-teacher-ready .initials{display:none;}
.compact-teacher-ready .teacher-subjects{justify-content:flex-start;gap:5px;}
.compact-teacher-ready .teacher-subjects .pill{font-size:10px;padding:4px 7px;line-height:1.3;}
.teacher-mobile-summary{display:block;order:2;margin-bottom:14px;}
.teacher-mobile-summary p{font-size:12px;line-height:1.5;margin:0;color:var(--muted);}
.teacher-mobile-summary .teacher-quick-experience{font-weight:600;color:var(--ink);margin-bottom:5px;}
.compact-teacher-ready .teacher-card-action{order:3;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0;margin:0;}
.teacher-profile-toggle{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 8px;background:transparent;border:1px solid var(--line);border-radius:9px;color:var(--green);font:600 12px Arial,sans-serif;cursor:pointer;}
.teacher-profile-toggle::after{content:'';width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px);}
.teacher-profile-toggle[aria-expanded="true"]::after{transform:rotate(225deg);}
.teacher-profile-toggle:focus-visible{outline:2px solid var(--green);outline-offset:3px;}
.compact-teacher-ready .teacher-card-action .teacher-enrol{min-height:44px;padding:10px 8px;font-size:12px;line-height:1.3;text-align:center;justify-content:center;border-radius:9px;}
.teacher-full-profile{order:4;margin-top:16px;padding-top:16px;border-top:1px solid var(--line);}
.teacher-full-profile .teacher-bio{margin-top:0;font-size:13px;line-height:1.7;}
.teacher-full-profile .offer-heading{margin-top:18px;}
.teacher-full-profile .teacher-schedule-note{margin-bottom:0;}
.teacher-full-profile details{margin-bottom:0;}
}

@media(min-width:0px){.teacher-full-profile{box-sizing:border-box;overflow:hidden;}}

/* Compact directory on every screen; full details remain available on demand. */
.teacher-grid.wrap{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;align-items:stretch}
.teacher-card.compact-teacher-ready{padding:22px;min-width:0}
.teacher-card.compact-teacher-ready h2{font-size:22px;line-height:1.3;margin-bottom:10px}
.compact-teacher-ready .teacher-top{min-height:30px}
.teacher-mobile-summary{flex:1;margin-bottom:18px}
.teacher-mobile-summary p{font-size:13px;line-height:1.6}
.teacher-mobile-summary .teacher-quick-experience{margin-bottom:6px}
.teacher-card.compact-teacher-ready .teacher-card-action{margin-top:auto;padding:0;gap:8px}
.teacher-card.compact-teacher-ready .teacher-profile-toggle,.teacher-card.compact-teacher-ready .teacher-card-action .teacher-enrol{font-size:12px;min-height:44px}
.teacher-shortlist-tools{order:-1;margin-bottom:14px}
.teacher-full-profile dl>div{grid-template-columns:minmax(80px,30%) minmax(0,1fr);gap:10px}
.teacher-full-profile dd{font-size:12px}
@media(max-width:1099px){.teacher-grid.wrap{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.teacher-grid.wrap{grid-template-columns:minmax(0,1fr);gap:12px}.teacher-card.compact-teacher-ready{padding:18px}.teacher-card.compact-teacher-ready h2{font-size:21px}.teacher-mobile-summary p{font-size:12px}}

.teacher-profile-modal-open{overflow:hidden}
.teacher-profile-dialog{box-sizing:border-box;width:min(760px,calc(100% - 64px));max-height:calc(100dvh - 64px);margin:auto;padding:0;border:1px solid var(--line);border-radius:20px;background:var(--cream);color:var(--ink);box-shadow:0 24px 90px #0004;overflow:auto}
.teacher-profile-dialog[open]{display:flex;flex-direction:column;animation:profile-dialog-in .3s cubic-bezier(.22,1,.36,1)}
.teacher-profile-dialog::backdrop{background:color-mix(in srgb,var(--theme-bg,var(--cream)) 78%,transparent)}
.profile-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 28px;border-bottom:1px solid var(--line);flex-shrink:0}
.profile-dialog-header h2{margin:0;font-size:26px;line-height:1.3}
.profile-dialog-close{width:44px;height:44px;flex-shrink:0;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink);font:28px/1 Arial;cursor:pointer}
.profile-dialog-body{padding:24px 28px;overflow:auto;min-height:0}
.teacher-profile-dialog .teacher-full-profile{margin:0;padding:0;border:0;overflow:visible}
.teacher-profile-dialog .teacher-bio{font-size:14px;line-height:1.7;margin:0 0 20px}
.teacher-profile-dialog .offer-heading{font-size:15px;margin:18px 0 10px}
.teacher-profile-dialog .teacher-offers{padding-left:20px;font-size:14px;line-height:1.7}
.teacher-profile-dialog dl>div{display:grid;grid-template-columns:140px minmax(0,1fr);gap:20px;padding:14px 0;border-bottom:1px solid var(--line);font-size:13px;line-height:1.6}
.teacher-profile-dialog dt{color:var(--muted)}
.teacher-profile-dialog dd{margin:0;text-align:right;font-weight:600;font-size:13px}
.teacher-profile-dialog .teacher-schedule-note{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);margin:18px 0}
.teacher-profile-dialog .teacher-us-notice{margin:18px 0;padding:12px;border-left:3px solid #c59b25;border-radius:6px;background:rgb(197 155 37 / .1);font-size:13px}
.teacher-profile-dialog .teacher-us-notice p{margin:4px 0;font-size:13px}
.profile-dialog-footer{padding:18px 28px;border-top:1px solid var(--line);flex-shrink:0}
.profile-dialog-footer .button{display:flex;justify-content:center;width:100%;box-sizing:border-box;margin:0}
.profile-dialog-close:focus-visible{outline:2px solid var(--green);outline-offset:3px}
@keyframes profile-dialog-in{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.teacher-profile-dialog[open]{animation:none}}

/* Eye affordance replaces the accordion chevron on profile actions. */
.teacher-card.compact-teacher-ready .teacher-profile-toggle::after{content:'';width:17px;height:17px;border:0;transform:none;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat}
.desktop-profile-card{cursor:pointer;transition:box-shadow .25s ease,border-color .25s ease}
.desktop-profile-card:hover{border-color:var(--green);box-shadow:0 8px 24px rgb(20 55 45 / .08)}
.desktop-profile-card:focus-visible{outline:2px solid var(--green);outline-offset:4px}
.teacher-profile-dialog details summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;list-style:none;padding:16px 0}
.teacher-profile-dialog details summary::-webkit-details-marker{display:none}
.teacher-profile-dialog details summary::after{content:none}
.teacher-profile-dialog .enquiry-content{overflow:hidden;display:flow-root;font-size:14px;line-height:1.65;color:var(--muted)}
.teacher-profile-dialog[open]{animation:profile-dialog-enter .34s cubic-bezier(.22,1,.36,1)}
.teacher-profile-dialog::backdrop{animation:profile-backdrop-enter .3s ease}
.teacher-profile-dialog.profile-dialog-closing::backdrop{animation:profile-backdrop-exit .22s ease forwards}
@keyframes profile-dialog-enter{from{opacity:0;transform:translateY(20px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes profile-backdrop-enter{from{background:rgb(10 30 26 / 0)}to{background:color-mix(in srgb,var(--theme-bg,var(--cream)) 78%,transparent)}}
@keyframes profile-backdrop-exit{to{background:rgb(10 30 26 / 0)}}
@media(prefers-reduced-motion:reduce){.teacher-profile-dialog[open],.teacher-profile-dialog::backdrop{animation:none}.desktop-profile-card{transition:none}}

.teacher-gender-icon{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;margin-left:7px;vertical-align:middle;border-radius:50%;background:var(--soft);color:var(--green);line-height:1}
.teacher-gender-icon svg{display:block;flex-shrink:0;width:16px;height:16px}

.teacher-gender-icon{width:30px;height:30px}.teacher-gender-icon svg{width:24px;height:24px}

.teacher-gender-icon{width:36px;height:36px;background:transparent;vertical-align:middle;margin-left:9px}.teacher-gender-icon svg{width:36px;height:36px}

/* A consistent avatar and name row in cards and desktop profiles. */
.teacher-card.compact-teacher-ready h2,.profile-dialog-header h2{display:flex;align-items:center;gap:10px;min-width:0;text-align:left}
.teacher-card h2 .teacher-gender-icon,.profile-dialog-header h2 .teacher-gender-icon{flex:0 0 36px;margin:0;align-self:center}

.teacher-new-badge{display:inline-flex;align-items:center;flex-shrink:0;align-self:center;padding:3px 8px;border:1px solid #b8d9ce;border-radius:20px;background:#e8f4ef;color:#245744;font:600 10px/1.4 Arial,Helvetica,sans-serif;letter-spacing:.2px;white-space:nowrap}
html[data-theme="dark"] .teacher-new-badge{background:#213e35;border-color:#4d7767;color:#c5eadb}

/* Keep the enquiry disclosure compact, without a trailing divider. */
.teacher-full-profile details{border-bottom:0;margin:8px 0 0;padding:0}
.teacher-full-profile details > summary{min-height:44px;box-sizing:border-box;padding:12px 0;align-items:center;font-size:14px}
.teacher-full-profile details .enquiry-content p{margin:0;padding:0 0 12px}
.teacher-profile-dialog .profile-dialog-body{padding-bottom:8px}
.teacher-profile-dialog .profile-dialog-footer{border-top:0;padding-top:12px}

/* Mobile disclosures keep stable spacing and animate one layout property. */
@media(max-width:1099px){
 .teacher-full-profile{margin-top:0;padding-top:16px;border-top:0;contain:paint;overflow-anchor:none}
 .teacher-card.profile-resizing{overflow-anchor:none}
 .teacher-card.compact-teacher-ready .teacher-profile-toggle::after{
  width:8px;height:8px;mask:none;-webkit-mask:none;background:none;
  border:0;border-right:1.7px solid currentColor;border-bottom:1.7px solid currentColor;
  transform:rotate(45deg) translateY(-2px);transition:transform .22s ease;
 }
 .teacher-card.compact-teacher-ready .teacher-profile-toggle[aria-expanded="true"]::after{transform:rotate(225deg)}
}
@media(prefers-reduced-motion:reduce){.teacher-profile-toggle::after{transition:none!important}}

/* Keep typography fixed while the mobile disclosure viewport expands. */
@media(max-width:1099px){
 .teacher-full-profile{position:relative;padding:0;flex-shrink:0;contain:layout paint;overflow-anchor:none}
 .teacher-profile-content{box-sizing:border-box;display:flow-root;padding-top:16px;top:0;left:0}
 .teacher-card.profile-resizing{box-shadow:none;transition:none}
 .teacher-grid{overflow-anchor:none}
}

