/* Shared home and calling proportions: keep artwork and controls together. */
html body[data-content-app] main:has(>.hero){padding-top:2px!important}
html body[data-content-app] main>.brand-context{margin-top:0!important;margin-bottom:8px!important;padding-top:0!important;padding-bottom:0!important}
html body[data-content-app] main>.hero{padding-top:4px!important;padding-bottom:8px!important;row-gap:3px!important;margin-bottom:4px!important}
html body[data-content-app] main>.hero .title{padding-top:0!important;padding-inline:0!important;grid-row:2!important}
html body[data-content-app] main>.hero .title h1{font-size:clamp(29px,7.8vw,48px)!important;line-height:1.08!important;text-wrap:balance;overflow-wrap:normal;hyphens:none}
html body[data-content-app] main>.hero>p{grid-row:3!important;font-size:clamp(17px,4.3vw,21px)!important;line-height:1.3!important;margin:1px 0 0!important;text-wrap:balance}
html body[data-content-app] main>.hero>.korys-primary-nav{grid-row:4!important;margin-top:8px!important}
html body[data-content-app] main>.campus-frame{aspect-ratio:1.2!important;margin-top:0!important;margin-bottom:0!important}
html body[data-content-app] main>.campus-frame>.campus{height:100%!important;width:100%!important;object-fit:cover!important;object-position:center top!important;transform:none!important}
html body[data-content-app] .coach-photo-caption{margin-top:8px!important;margin-bottom:14px!important}
html[data-theme] body main:has(>.coach-header)>.coach-header{grid-template-rows:64px!important;min-height:64px!important;margin-bottom:0!important}
html[data-theme] body main:has(>.coach-header)>.portrait{height:clamp(210px,calc(100svh - 282px),610px)!important;margin-top:0!important;padding:0!important}
html[data-theme] body main.coach-page>.call-portrait-stage{margin-top:0!important}
html[data-theme] body main.coach-page .coach-avatar{width:clamp(240px,min(94vw,calc(100svh - 260px)),460px)!important;margin:0 auto!important}
html[data-theme] body :is(main.coach-page,main:has(>.coach-header))>:is(.intro,.soon-note){font-size:clamp(20px,5.2vw,25px)!important;line-height:1.25!important;margin:0 0 6px!important;text-wrap:balance}
html[data-theme] body :is(main.coach-page,main:has(>.coach-header)) :is(.contact-actions,.controls){margin-top:8px!important}
/* Center both the button on the portrait and its chevron inside the button. */
html[data-theme] body main.coach-page>.call-portrait-stage>.back-link{top:50%!important;translate:0 -50%!important;transform:none!important;display:grid!important;place-items:center!important;align-content:center!important;line-height:1!important;padding:0!important}
html[data-theme] body main.coach-page>.call-portrait-stage>.back-link>svg{display:block!important;margin:0!important;align-self:center!important;justify-self:center!important;transform:none!important;translate:none!important}
@media(min-width:760px){html body[data-content-app] main>.campus-frame{aspect-ratio:1.4!important}}
@media(max-width:360px){html body[data-content-app] main>.hero .title h1{font-size:clamp(27px,7.8vw,29px)!important}}
@media(max-height:600px){
 html[data-theme] body main:has(>.coach-header)>.portrait{height:clamp(120px,calc(100svh - 278px),318px)!important}
 html[data-theme] body main.coach-page .coach-avatar{width:clamp(150px,min(88vw,calc(100svh - 260px)),320px)!important}
}

/* Let the sharp native alpha contour define the edge in every theme. */
html[data-theme] body :is(.campus,.coach-portrait,main>.portrait img){mask-image:none!important;-webkit-mask-image:none!important;opacity:1!important;mix-blend-mode:normal!important;transition:none!important;animation:none!important}

/* Align the logo and colour/language controls along the same top edge. */
html[data-theme] body main>.hero :is(.identity,.language-nav),
html[data-theme] body main>:is(.call-header,.coach-header)>:is(.logo-home,.brand,.language-nav){align-self:start!important;margin-top:0!important;translate:none!important}
html[data-theme] body main>.hero .identity{transform:none!important}
html[data-theme] body main>.hero .identity .logo,
html[data-theme] body main>.call-header .logo-home img{object-position:center top!important;display:block!important;margin-top:0!important}

/* Today opens at its heading, with the opening video frame as the main content. */
html body #korys-content-panel[data-view=today]{padding-top:0!important;min-height:100svh;scroll-margin-top:0}
html body #korys-content-panel[data-view=today]>h2{margin:0 0 12px!important;scroll-margin-top:0;font-size:clamp(28px,7vw,36px)}
html body #korys-content-panel[data-view=today]>.video-test{padding:0!important;border:0!important;margin:0!important}
html body #korys-content-panel[data-view=today]>.video-test>h3{margin:0 0 10px!important;font-size:clamp(18px,4.5vw,23px);line-height:1.25}
.training-video-frame{position:relative;width:100%;margin:0 auto;max-width:460px}
html body .training-video-frame>video{display:block!important;width:100%!important;max-width:none!important;height:auto!important;max-height:calc(100svh - 115px)!important;aspect-ratio:9/16;object-fit:contain;background:transparent!important;border-radius:14px;margin:0!important}
html body .training-video-frame>.training-video-play{position:absolute;inset:0;display:grid;place-items:center;width:100%;height:auto;padding:0;margin:0;border:0;background:transparent;box-shadow:none;cursor:pointer}
html body .training-video-frame>.training-video-play>svg{width:72px;height:72px;color:var(--theme-action,#32593d);filter:drop-shadow(0 2px 8px #0006)}
html body .training-video-frame>.training-video-play[hidden],html body .video-mini-quiz[hidden]{display:none!important}
.video-mini-quiz{scroll-margin-top:12px}

/* Keep exercise navigation outside the scrolling content, inside the modal. */
html[data-theme] body dialog.lesson-dialog{height:calc(100dvh - 32px)!important;max-height:calc(100dvh - 32px)!important;padding:0!important;overflow:hidden!important}
html[data-theme] body dialog.lesson-dialog>.lesson-scroll{box-sizing:border-box;height:100%;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:76px 24px 92px;scroll-padding-top:12px;scroll-padding-bottom:92px}
html[data-theme] body dialog.lesson-dialog>.lesson-toolbar{position:absolute;inset:0 0 auto;height:68px;padding:12px 20px;margin:0!important;z-index:5;background:var(--theme-surface,#fff);display:flex;justify-content:flex-end;align-items:center}
html[data-theme] body dialog.lesson-dialog>.lesson-toolbar>.lesson-close{position:absolute;left:16px;right:auto;top:10px;margin:0!important;width:48px!important;height:48px!important;min-height:48px!important;display:grid;place-items:center;padding:0!important;background:var(--theme-card,#f4f6f5)!important;color:var(--theme-accent,#701c32)!important}
html[data-theme] body dialog.lesson-dialog>.lesson-toolbar>.lesson-back{display:none!important}
html[data-theme] body dialog.lesson-dialog>.lesson-back-footer{position:absolute;right:16px;left:auto;bottom:max(12px,env(safe-area-inset-bottom));z-index:5;margin:0!important;padding:0!important}
html[data-theme] body dialog.lesson-dialog>.lesson-back-footer>.lesson-back{margin:0!important;background:var(--theme-card,#f4f6f5)!important;color:var(--theme-accent,#701c32)!important;box-shadow:0 2px 12px #0002!important}
@media(max-width:500px){html[data-theme] body dialog.lesson-dialog>.lesson-scroll{padding-left:20px;padding-right:20px}}

/* Use the mobile viewport evenly, including locales with longer titles. */
@media(max-width:759px){
 html,html body{box-sizing:border-box;width:100%;max-width:100%;min-width:0;margin:0}
 html[data-theme] body>main{box-sizing:border-box!important;width:100%!important;max-width:none!important;min-width:0!important;margin-inline:0!important;padding-inline:8px!important}
 html[data-theme] body[data-content-app] main>:is(.hero,.campus-frame,.coach-photo-caption,.brand-context,#korys-content-panel){box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;margin-inline:0!important}
 html[data-theme] body[data-content-app] main .brand-context,html[data-theme] body main>.hero .title,html[data-theme] body main>.hero .title h1{white-space:normal!important;overflow-wrap:anywhere!important;min-width:0!important;max-width:100%!important}
}

/* 11 Oct: lift the complete call navigation row 8px, all themes/locales. */
html[data-theme] body :is(main.coach-page,main:has(>.coach-header)){padding-top:2px!important}

/* Theme-coloured opaque play disc, centred over the video in every appearance. */
html body .training-video-frame>.training-video-play>svg>path{fill:var(--primary-ink,#fff)}
html body .training-video-frame>.training-video-play:focus-visible{outline:3px solid var(--theme-accent,#32593d);outline-offset:3px;border-radius:14px}

/* Scoped training navigation stays above the scrolling lesson, never on home. */
#korys-content-panel[data-view=today],#korys-content-panel[data-view=library]{padding-top:76px;scroll-margin-top:76px}
.training-chrome{position:fixed;z-index:40;top:max(12px,env(safe-area-inset-top));left:max(16px,calc((100vw - 640px)/2));right:max(16px,calc((100vw - 640px)/2));display:flex;justify-content:space-between;pointer-events:none}
.training-chrome button{display:grid;place-items:center;box-sizing:border-box;pointer-events:auto;width:48px;height:48px;min-height:48px;margin:0;padding:0;border:1px solid var(--theme-border,#819b77);border-radius:50%;background:var(--theme-card,#bdd2b2);color:var(--theme-text,#263b29);box-shadow:0 2px 10px #0002;cursor:pointer}
.training-chrome svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.training-chrome button:focus-visible{outline:3px solid var(--theme-accent,#32593d);outline-offset:3px}
#korys-content-panel[data-view=today]>h2,#korys-content-panel[data-view=library]>h2{scroll-margin-top:76px}
.video-mini-quiz{scroll-margin-top:76px!important}

main>.hero .identity[role=button]{cursor:pointer;border-radius:12px}
main>.hero .identity[role=button]:focus-visible{outline:3px solid var(--theme-accent,#32593d);outline-offset:4px}

.training-chrome .training-back{border:0;background:transparent;box-shadow:none}
.training-chrome .training-back svg{width:32px;height:32px;stroke-width:1.5}

/* User: back at left-centre, close remains at the top-right. */
.training-chrome .training-back{position:fixed;left:max(8px,env(safe-area-inset-left));top:auto;bottom:max(12px,env(safe-area-inset-bottom));transform:none;z-index:60}

.video-mini-quiz{padding-bottom:80px!important}.vq-selected-feedback{scroll-margin-top:calc(80px + env(safe-area-inset-top))}

/* All call back links share the viewport bottom-left position. */
html[data-theme] body main.coach-page>.call-portrait-stage>.back-link.korys-back-button{position:fixed!important;top:auto!important;bottom:max(12px,env(safe-area-inset-bottom))!important;left:max(8px,env(safe-area-inset-left))!important;right:auto!important;translate:none!important;transform:none!important;z-index:60!important}
html[data-theme] body :is(main.coach-page,main:has(>.coach-header)){padding-bottom:calc(80px + env(safe-area-inset-bottom))!important}

/* Shared compact section headings and more room inside themed training cards. */
html body #korys-content-panel:is([data-view=today],[data-view=library]){padding-top:8px!important;scroll-margin-top:80px}
html body #korys-content-panel:is([data-view=today],[data-view=library])>h2{box-sizing:border-box;margin:0 0 12px!important;padding:12px 22px!important;font-size:clamp(28px,7vw,36px)!important;font-weight:700;line-height:1.25;scroll-margin-top:calc(80px + env(safe-area-inset-top));background:var(--quiet-card,var(--theme-card,#ccdced))!important;border-radius:14px;overflow-wrap:anywhere}
html body #korys-content-panel .content-entry{box-sizing:border-box;padding:20px 22px!important;max-width:100%;overflow-wrap:anywhere}
html body #korys-content-panel .content-entry>h3{margin:0 0 12px!important;padding:0!important;line-height:1.35}
@media(max-width:400px){html body #korys-content-panel:is([data-view=today],[data-view=library])>h2,html body #korys-content-panel .content-entry{padding-left:20px!important;padding-right:20px!important}}

html[data-theme] body main>.portrait>.home-back.korys-back-button{position:fixed!important;top:auto!important;bottom:max(12px,env(safe-area-inset-bottom))!important;left:max(8px,env(safe-area-inset-left))!important;right:auto!important;translate:none!important;transform:none!important;z-index:60!important}

/* Latest user: large simple circle back; calls left-centre, training bottom-left. */
.training-chrome .training-back{width:64px;height:64px;min-height:64px}.training-chrome .training-back svg{width:52px;height:52px}
html[data-theme] body main.coach-page>.call-portrait-stage>.back-link.korys-back-button,html[data-theme] body main>.portrait>.home-back.korys-back-button{position:fixed!important;top:50%!important;bottom:auto!important;left:max(8px,env(safe-area-inset-left))!important;right:auto!important;transform:translateY(-50%)!important;translate:none!important;z-index:60!important}
.video-mini-quiz{padding-bottom:96px!important}

/* Slightly shift the top-left brand inside its existing safe-area layout. */
html[data-theme] body main>.hero .identity,html[data-theme] body main>.call-header .logo-home,html[data-theme] body main>.coach-header>.brand{position:relative;left:-6px!important}
/* User: themed training surfaces without a black rim or hard shadow. */
html[data-theme] body #korys-content-panel:is([data-view=today],[data-view=library])>h2,html[data-theme] body #korys-content-panel .content-entry{border:0!important;outline:0;box-shadow:none!important}

/* Back is removed from flex flow; anchor close explicitly to the physical right. */
html[data-theme] body .training-chrome>button:not(.training-back){position:fixed!important;top:max(12px,env(safe-area-inset-top))!important;right:max(12px,env(safe-area-inset-right))!important;left:auto!important;bottom:auto!important;z-index:61!important}
html[data-theme] body #korys-content-panel:is([data-view=today],[data-view=library])>h2{display:block!important;width:100%!important;max-width:100%!important;padding:18px 22px!important;background:var(--theme-card,#ccdced)!important;border:0!important;box-shadow:none!important;border-radius:14px!important;margin:0 0 12px!important}
html[data-theme] body #korys-content-panel .video-test>h3{box-sizing:border-box!important;display:block!important;width:100%!important;padding:20px 22px!important;background:var(--theme-card,#ccdced)!important;border:0!important;box-shadow:none!important;border-radius:14px!important;margin:0 0 12px!important;overflow-wrap:anywhere}

html[data-theme] body button.korys-home-return:not([hidden]){position:fixed!important;left:max(8px,env(safe-area-inset-left))!important;bottom:max(12px,env(safe-area-inset-bottom))!important;top:auto!important;right:auto!important;display:grid!important;place-items:center!important;width:64px!important;min-width:64px!important;height:64px!important;padding:0!important;border:0!important;background:transparent!important;color:var(--theme-accent,#701c32)!important;z-index:60!important}
html body button.korys-home-return[hidden]{display:none!important}html body button.korys-home-return svg{width:52px!important;height:52px!important;pointer-events:none}

html[data-theme] body button.korys-home-close:not([hidden]){position:fixed!important;right:max(12px,env(safe-area-inset-right))!important;top:max(12px,env(safe-area-inset-top))!important;left:auto!important;bottom:auto!important;display:grid!important;place-items:center!important;width:48px!important;height:48px!important;padding:0!important;border:1px solid var(--theme-border,#819bb5)!important;border-radius:50%!important;background:var(--theme-card,#ccdced)!important;color:var(--theme-text,#20374f)!important;z-index:61!important}
html body button.korys-home-close[hidden]{display:none!important}html body button.korys-home-close svg{width:24px!important;height:24px!important;pointer-events:none}
