/* Talap Education v266 | Mobile-first UX layer.
 * Desktop layouts and all course/editor persistence logic are unchanged. */
@media(max-width:980px){
  body.lmsDashboardPage .lmsLayout, body.adminDashboardPage .lmsLayout,
  body.courseLearningPage .lmsLayout {min-width:0!important;}
  body.adminDashboardPage .contentCol, body.lmsDashboardPage .contentCol,
  body.courseLearningPage .contentCol,body.adminCourseEditorPage .contentCol {min-width:0;width:100%;}
  body.adminCourseEditorPage .courseEditorSideFields{position:static;}
}
@media(min-width:761px){.tauMobileSectionToggle,.tauMobileEditorSwitcher{display:none!important}}
@media(max-width:760px){
  /* Phone-friendly tap targets and accessible text sizing. */
  html{scroll-padding-top:70px;-webkit-text-size-adjust:100%}
  body{background-attachment:scroll;overflow-x:clip;}
  body:not(.page-loading){min-width:0;}
  .container{max-width:100%!important;padding-inline:16px!important;}
  .pageWrap{padding-top:16px!important;padding-bottom:48px!important;}
  .panel{border-radius:20px;padding:16px;box-shadow:0 8px 28px rgba(27,29,71,.06)}
  .contentCol,.contentCol > *,main,.lmsLayout,.grid-2,.adminGrid{min-width:0!important;}
  .header{position:relative;top:auto;backdrop-filter:none;background:#fff;}
  .header-inner{height:68px;min-height:68px;gap:10px;}
  .brand-logo-compact{max-width:126px!important;height:auto!important;max-height:62px!important;object-fit:contain;}
  .header-actions{gap:7px;}
  .header-actions .btn:not([hidden]){min-height:44px;padding:9px 12px;font-size:12px;}
  .header-actions .burger{flex:0 0 44px;}
  .mobile-menu{box-shadow:0 14px 30px rgba(10,18,54,.09)}
  .mobile-inner{max-height:calc(100dvh - 75px);overflow-y:auto;overscroll-behavior:contain;gap:8px;padding-block:14px 20px;}
  .mobile-link{display:flex;align-items:center;min-height:45px;padding:11px 14px;}
  .mobile-auth{display:grid;gap:8px;}
  .topbar{background:#f7f8fe;}
  .topbar-inner{height:34px;min-height:34px;justify-content:center;}
  .topbar-left,.topbar-right > a.ribbon-icon{display:none!important;}
  .topbar-right .lang{gap:12px;padding:0;}
  .topbar-right .lang-btn{min-height:32px;min-width:40px;font-size:12px;}
  .btn,button,.select,input,textarea{touch-action:manipulation;}
  :where(.btn, .sideLink, .courseStudioNavBtn, .mobile-link, .tauMobileSectionToggle){min-height:44px;}
  :where(input,textarea,select,.input,.select,.field input,.field select,.field textarea){font-size:16px!important;max-width:100%;}
  :where(input[type="file"]){width:100%;min-width:0;max-width:100%;white-space:normal;}
  :where(input[type="checkbox"],input[type="radio"]){min-width:18px;min-height:18px;accent-color:#6146b2;}
  :where(.formGrid,.grid-2,.adminGrid){grid-template-columns:minmax(0,1fr)!important;}
  .section-head{align-items:flex-start;flex-wrap:wrap;}
  .section-head .btn,.section-head > .btn{max-width:100%;white-space:normal;}
  .float-social{right:10px;bottom:12px;gap:8px;}
  .float-btn{width:44px;height:44px;}
  .sticky-consult{right:10px;top:auto;bottom:110px;transform:none;padding:10px 13px;max-width:55vw;}
  .sticky-consult:hover{transform:none;}
  .backdrop,.modalOverlay,.modal-backdrop{padding:10px;}
  .modalCard{width:100%;max-height:calc(100dvh - 25px);overflow-y:auto;overscroll-behavior:contain;}
  .modalActions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .modalActions .btn{min-width:0;width:100%;white-space:normal;}
  /* Replace the 10+ tab sidebar scroller by an expandable menu. */
  .tauMobileSectionToggle{width:100%;display:flex;align-items:center;gap:12px;min-height:62px;padding:10px 14px;
    margin:0 0 10px;border:1px solid #ddd8ef;border-radius:18px;background:#fff;
    text-align:left;color:#30245e;box-shadow:0 6px 18px rgba(40,27,105,.07);cursor:pointer;}
  .tauMobileToggleGlyph{display:grid;place-items:center;width:38px;height:38px;flex:0 0 38px;
    background:#eeeafd;border-radius:12px;color:#51369b;font-size:20px;}
  .tauMobileToggleCopy{display:flex;flex:1;flex-direction:column;min-width:0;gap:1px;}
  .tauMobileToggleCopy small{font-size:10px;text-transform:uppercase;font-weight:800;letter-spacing:.09em;color:#74698e;}
  .tauMobileToggleCopy strong{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .tauMobileToggleArrow{font-size:22px;font-weight:800;line-height:1;transition:transform .2s;}
  .tauMobileSectionToggle.is-open .tauMobileToggleArrow{transform:rotate(180deg)}
  body.lmsDashboardPage .sideNav[data-tau-mobile-ready],body.adminDashboardPage .sideNav[data-tau-mobile-ready],
  body.courseLearningPage .sideNav[data-tau-mobile-ready]{display:none!important;}
  body.lmsDashboardPage .sideNav.tauMobileNavOpen,body.adminDashboardPage .sideNav.tauMobileNavOpen,
  body.courseLearningPage .sideNav.tauMobileNavOpen{display:grid!important;position:static!important;overflow:visible!important;
    max-height:unset!important;white-space:normal!important;gap:6px!important;padding:13px!important;margin:0 0 13px!important;
    background:#fff!important;box-shadow:0 10px 28px rgba(39,24,90,.08)!important;border-radius:18px!important;}
  body.lmsDashboardPage .sideNav.tauMobileNavOpen .appNavSection,
  body.adminDashboardPage .sideNav.tauMobileNavOpen .appNavSection{display:block!important;padding:13px 6px 4px;font-size:11px;}
  body.lmsDashboardPage .sideNav.tauMobileNavOpen .appNavSection:first-of-type,
  body.adminDashboardPage .sideNav.tauMobileNavOpen .appNavSection:first-of-type{padding-top:4px;}
  body.lmsDashboardPage .sideNav.tauMobileNavOpen .sideLink,
  body.adminDashboardPage .sideNav.tauMobileNavOpen .sideLink,
  body.courseLearningPage .sideNav.tauMobileNavOpen .sideLink{display:flex!important;width:100%;max-width:none!important;
    white-space:normal!important;min-height:45px!important;flex:initial!important;align-items:center;
    padding:11px 12px!important;border-radius:12px;font-size:14px;}
  body.lmsDashboardPage .sideNav.tauMobileNavOpen .sideLink span:last-child,
  body.adminDashboardPage .sideNav.tauMobileNavOpen .sideLink span:last-child{max-width:none!important;white-space:normal!important;}
  /* Student dashboard: tidy welcome cards; remove squeezed fixed heights. */
  body.lmsDashboardPage .lmsWelcomeHero,body.adminDashboardPage .adminHeroV257{
    padding:22px 18px;border-radius:22px;min-height:0;}
  body.lmsDashboardPage .lmsWelcomeHero h1,body.adminDashboardPage .adminHeroV257 h1{font-size:clamp(25px,7vw,32px);line-height:1.15;}
  .lmsHeroActions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .lmsHeroActions .btn{min-width:0;white-space:normal;text-align:center;font-size:13px;padding:12px 8px;}
  .lmsMetricGrid,.adminMetricGrid{gap:9px;}
  .lmsMetric,.adminMetricGrid article{min-width:0;padding:12px!important;}
  .lmsMetric small,.adminMetricGrid small{font-size:11px;line-height:1.35;overflow-wrap:anywhere;}
  body.lmsDashboardPage #coursesGrid.cardsGrid{grid-template-columns:1fr!important;gap:14px;}
  body.lmsDashboardPage .dashboardCourseCard{border-radius:20px;overflow:hidden;}
  body.lmsDashboardPage .dashboardCourseMedia{height:clamp(165px,48vw,220px);flex-basis:auto!important;}
  body.lmsDashboardPage .dashboardCourseCard .courseTop{padding:16px;}
  body.lmsDashboardPage .dashboardCourseCard .courseMeta{display:flex!important;flex-direction:column!important;
    gap:0!important;grid-template-rows:none!important;min-height:0!important;}
  body.lmsDashboardPage .dashboardCourseDescriptionV261{min-height:0!important;max-height:94px!important;line-clamp:4!important;-webkit-line-clamp:4!important;}
  body.lmsDashboardPage .dashboardCourseStatsV261{min-height:0!important;grid-template-rows:auto 7px auto 7px!important;}
  body.lmsDashboardPage .dashboardCourseActionsV261{grid-template-columns:1fr!important;}
  body.lmsDashboardPage .dashboardCourseActionsV261 .btn{min-height:46px!important;}
  /* Admin: comfortable lists, cards and actions. */
  body.adminDashboardPage .adminCoursesViewShell,body.adminDashboardPage #courseListPanel{padding:13px!important;}
  body.adminDashboardPage .adminCourseRow,body.adminDashboardPage .adminCourseListItem{max-width:100%;}
  body.adminDashboardPage .courseAdminGrid{display:block!important;}
  body.adminDashboardPage :where(.courseStudentToolbar,.courseStudentAccessActions,.courseTeacherAccessActions){flex-wrap:wrap;}
  /* Structured tables render as independently readable record cards instead of 980px-wide tables. */
  .scrollTable,.tableWrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
  table.tauMobileCardTable{display:block!important;width:100%!important;min-width:0!important;border:0!important;
    background:transparent!important;overflow:visible!important;border-collapse:separate;}
  table.tauMobileCardTable[style*="display:none"],table.tauMobileCardTable[style*="display: none"]{display:none!important;}
  table.tauMobileCardTable thead{display:none!important;}
  table.tauMobileCardTable tbody{display:grid!important;gap:12px;min-width:0;}
  table.tauMobileCardTable tbody tr{display:grid!important;min-width:0;gap:0;padding:6px 14px;
    border:1px solid #e6e3f0;border-radius:16px;background:#fff;box-shadow:0 3px 12px rgba(42,28,96,.04);}
  table.tauMobileCardTable tbody tr > td{display:grid!important;grid-template-columns:minmax(90px,35%) minmax(0,1fr);align-items:start;
    gap:10px;min-width:0;width:100%!important;min-height:44px;padding:12px 0;border:0!important;
    border-bottom:1px solid #f0edf7!important;text-align:left;overflow-wrap:anywhere;font-size:13px;}
  table.tauMobileCardTable tbody tr > td:last-child{border-bottom:0!important;}
  table.tauMobileCardTable tbody tr > td:before{content:attr(data-tau-label);font-weight:800;
    color:#786e90;font-size:11px;line-height:1.4;overflow-wrap:anywhere;}
  table.tauMobileCardTable tbody tr > td .btn{min-height:42px;margin:2px;max-width:100%;white-space:normal;}
  table.tauMobileCardTable tbody tr.tauMobileKeepRow{display:table-row!important;}
  table.tauMobileCardTable tbody tr.tauMobileKeepRow > td{display:table-cell!important;}
  table.tauMobileCardTable tbody tr.tauMobileKeepRow > td:before{display:none;}
  /* Learning: collapse lesson list; keep media and uploads in the viewport. */
  body.courseLearningPage .coursePageWrap{padding-bottom:50px!important;}
  body.courseLearningPage .courseHeroV257{min-height:230px;border-radius:20px;}
  body.courseLearningPage .courseHeroContent{padding:20px 18px;}
  body.courseLearningPage .courseHeroContent h1{font-size:clamp(24px,6.7vw,30px);line-height:1.15;}
  body.courseLearningPage .courseHeroContent p{font-size:13px;line-height:1.45;}
  body.courseLearningPage .courseNavigatorV257.tauMobileNavOpen{background:linear-gradient(180deg,#2d1a70,#20144f)!important;}
  body.courseLearningPage .courseNavigatorV257.tauMobileNavOpen .sideLink{color:#fff;}
  body.courseLearningPage :where(video,iframe,object,embed){max-width:100%;}
  body.courseLearningPage video{width:100%;height:auto;}
  body.courseLearningPage :where(#hwFile,#hwText,#hwLink){max-width:100%;width:100%;}
  body.courseLearningPage .quizNav{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}
  body.courseLearningPage .quizNav > span{display:none;}
  body.courseLearningPage .quizNav .btn{width:100%;min-width:0;white-space:normal;}
  /* Editor: one section selector instead of swiping through seven tiny tabs. */
  body.adminCourseEditorPage .pageWrap{padding:10px 12px 54px!important;}
  body.adminCourseEditorPage #courseEditorPanel{padding:0!important;}
  body.adminCourseEditorPage .courseEditorCommandBar{display:flex!important;flex-direction:column;gap:12px;
    padding:15px!important;margin-bottom:13px;position:static!important;top:auto!important;box-shadow:0 6px 20px rgba(46,31,99,.07);}
  body.adminCourseEditorPage .courseEditorCommandMain{display:flex;flex-direction:column;align-items:stretch;gap:10px;width:100%;}
  body.adminCourseEditorPage .courseEditorBackBtn{align-self:flex-start;min-height:40px;padding:8px 12px;}
  body.adminCourseEditorPage .courseEditorCommandTitle{width:100%;}
  body.adminCourseEditorPage .courseEditorCommandTitle h3{font-size:23px;line-height:1.12;}
  body.adminCourseEditorPage .courseEditorCommandTitle .sub{white-space:normal;overflow:visible;
    font-size:12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
  body.adminCourseEditorPage.tauMobileEditorReady .courseStudioTopNav{display:none!important;}
  body.adminCourseEditorPage .tauMobileEditorSwitcher{width:100%;display:grid;gap:6px;order:2;}
  .tauMobileEditorSwitcher label{font-size:12px;font-weight:850;color:#625485;}
  .tauMobileEditorSelect{width:100%;height:54px;min-height:54px;border:1.5px solid #d5ccef;
    border-radius:14px;background:#f8f6ff;color:#38266d;font-size:16px;font-weight:800;
    padding:0 14px;}
  .tauMobileEditorSelect:focus-visible{outline:3px solid rgba(83,54,165,.25);outline-offset:2px;}
  body.adminCourseEditorPage .courseEditorCommandActions{order:3;width:100%;display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:9px;}
  body.adminCourseEditorPage .courseEditorCommandActions .btn{min-width:0!important;min-height:48px;
    padding:12px 8px;white-space:normal;}
  body.adminCourseEditorPage .courseEditorPrimarySave{background:#5a40af;color:#fff;border-color:#5a40af;}
  body.adminCourseEditorPage .courseSaveFeedback{order:4;}
  body.adminCourseEditorPage .courseEditorSection{padding:14px!important;border-radius:18px;box-shadow:0 5px 16px rgba(46,31,99,.05);
    scroll-margin-top:18px!important;}
  body.adminCourseEditorPage .courseEditorSectionHeading{display:block;margin-bottom:15px;}
  body.adminCourseEditorPage .courseEditorSectionHeading h3{font-size:21px;line-height:1.18;}
  body.adminCourseEditorPage :where(.courseEditorBasicsGrid,.courseEditorPriceGrid,.courseEditorSideFields,
    .courseStudioContentWorkspace,.courseStudioOptionGrid,.courseStudioQuizWorkspace,.courseStudioInlineQuiz){
    grid-template-columns:minmax(0,1fr)!important;}
  body.adminCourseEditorPage .formGrid{grid-template-columns:minmax(0,1fr)!important;}
  body.adminCourseEditorPage :where(.courseEditorMainFields,.courseStudioModuleRail,.courseStudioTopicRail,
    .courseStudioTopicMain,.courseStudioQuestionCard,.courseStudioFileCard,.courseStudioPresentationCard){min-width:0;}
  body.adminCourseEditorPage .courseStudioRailList{display:flex!important;gap:8px;overflow-x:auto;overscroll-behavior-inline:contain;
    scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;max-width:100%;padding:5px 2px 12px;}
  body.adminCourseEditorPage .courseStudioListItem{min-width:min(73vw,270px);max-width:min(73vw,270px);scroll-snap-align:start;}
  body.adminCourseEditorPage .courseStudioTopicTabs{display:flex;flex-wrap:nowrap;overflow-x:auto;
    scrollbar-width:thin;padding:4px 0 10px;-webkit-overflow-scrolling:touch;}
  body.adminCourseEditorPage .courseStudioTopicTabs .courseStudioTopicTab{min-height:44px;white-space:nowrap;}
  body.adminCourseEditorPage .courseStudioQuestionCardHead{flex-wrap:wrap;}
  body.adminCourseEditorPage .courseStudioSelectedTopicHeader{gap:10px;}
  body.adminCourseEditorPage .courseStudioUploadRow{display:grid!important;grid-template-columns:minmax(0,1fr);}
  body.adminCourseEditorPage .courseStudioUploadRow input[type=file]{min-width:0;width:100%;}
  body.adminCourseEditorPage .courseStudioUploadRow .btn{width:100%;}
  body.adminCourseEditorPage .courseEditorBottomBar{position:static!important;padding:15px;display:grid;}
  body.adminCourseEditorPage .courseEditorBottomActions{display:grid;grid-template-columns:1fr;gap:8px;}
  body.adminCourseEditorPage .courseEditorBottomActions .btn{width:100%;}
  /* Certificate designer: previous mobile rules hid the entire element palette! */
  body.adminDashboardPage .certDesignModal,body.adminCourseEditorPage .certDesignModal{padding:6px;}
  .certDesignShell{min-height:0!important;height:calc(100dvh - 12px)!important;max-height:calc(100dvh - 12px);
    display:flex!important;flex-direction:column;overflow:hidden;border-radius:15px;}
  .certDesignTopbar{flex-wrap:wrap;padding:10px;gap:8px;flex:0 0 auto;}
  .certDesignToolbar{width:100%;overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;}
  .certDesignToolbar > *{flex:0 0 auto;}
  .certDesignBody{display:flex!important;flex-direction:column;overflow-y:auto;min-height:0;flex:1;}
  .certDesignSidebar{display:block!important;overflow-y:auto;max-height:180px;flex-shrink:0;padding:10px;}
  .certCanvasWrap{padding:22px!important;min-height:300px;flex:0 0 300px;}
  .certDesignProps{display:block!important;max-height:none!important;padding:13px;flex:1 0 auto;overflow:visible;}
  .certControlsGrid{grid-template-columns:minmax(0,1fr)!important;}
  /* Certificate lookup + login: full-width controls, no keyboard zoom on iOS. */
  .certificateCheckSearch{grid-template-columns:minmax(0,1fr)!important;}
  .certificateCheckSearch input,.certificateCheckSearch .btn{width:100%;min-width:0;}
  body.authPage .pageWrap{padding-top:18px!important;}
  body.authPage .tabRow{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  body.authPage .tabRow .btn{width:100%;min-width:0;white-space:normal;}
}
@media(max-width:440px){
  .container{padding-inline:13px!important;}
  .header-actions #navLogin,.header-actions #navLogout{display:none!important;}
  .lmsMetricGrid,.adminMetricGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.lmsDashboardPage .dashboardCoursePriceV261{padding:10px 12px!important;gap:6px!important;}
  body.lmsDashboardPage .dashboardCoursePriceValueV261 .priceNow{font-size:21px!important;}
  body.courseLearningPage .courseHeroV257{min-height:250px;}
  body.adminCourseEditorPage .courseStudioRailList .courseStudioListItem{min-width:76vw;max-width:76vw;}
  body.adminCourseEditorPage .courseStudioOptionGrid{gap:10px;}
  .certDesignToolbar{gap:6px;}

}
@media(max-width:620px){
  /* Public landing page */
  body.page-loading .hero,body.page-loaded .hero{padding:42px 0 38px;}
  .shell{width:calc(100% - 28px)!important;}
  .hero-grid{gap:10px;}
  .hero-copy{text-align:left!important;}
  .hero-copy h1{font-size:clamp(30px,8vw,37px)!important;line-height:1.12;letter-spacing:-.035em;}
  .hero-copy > p:not(.eyebrow){font-size:14px;line-height:1.6;}
  .hero-actions{display:grid;grid-template-columns:1fr;justify-content:stretch!important;gap:9px;}
  .hero-actions .button{width:100%;justify-content:center;min-height:48px;}
  .hero-trust{justify-content:flex-start!important;gap:10px!important;}
  .hero-visual{min-height:245px!important;}
  .hero-reference-art{width:100%!important;max-height:280px;object-fit:contain;}
  .why-grid,.direction-grid{grid-template-columns:1fr!important;gap:11px;}
  .why-card,.direction-card{min-height:0!important;padding:20px!important;}
  .steps-grid{grid-template-columns:1fr 1fr;}
  .section{padding:50px 0!important;}
  .section-title{font-size:clamp(24px,6vw,30px)!important;}
  .platform-visual{min-height:240px;}
  .course-card,.news-card{width:min(84vw,330px);}
  .cta-card{padding:25px 18px;}
  .floating-consult{right:10px;bottom:12px;max-width:calc(100vw - 20px);padding:12px 14px;}
  .footer-grid{grid-template-columns:1fr 1fr;gap:18px;}
  .footer-brand,.footer-newsletter{grid-column:1/-1;}
  .consult-modal{max-height:calc(100dvh - 20px);overflow:auto;}
}
@media(prefers-reduced-motion:reduce){.tauMobileToggleArrow{transition:none}}
