/* Pythonic's shared HTML5 player; independent of Core access and third-party/CDN libraries. */
.py-course-player{position:relative;isolation:isolate;width:100%;max-width:100%;min-width:0;background:#030b17;color:#fff;font:400 13px/1.7 Vazirmatn,Tahoma,sans-serif;outline-offset:3px;touch-action:manipulation}
.py-course-player video{display:block;width:100%;height:100%;object-fit:contain;background:#030b17}
.py-course-player [hidden]{display:none!important}.py-course-player *{box-sizing:border-box}
.py-course-player .py-player-btn{display:inline-flex;flex:none;align-items:center;justify-content:center;width:38px;height:38px;min-width:38px;min-height:38px;padding:8px;margin:0;border:1px solid transparent;border-radius:10px;background:transparent;color:#fff;font:inherit;box-shadow:none;cursor:pointer;line-height:1;text-decoration:none}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-btn{padding:8px;min-height:38px;background:transparent;color:#fff;border:1px solid transparent;font-size:12px}
.py-course-player .py-player-btn svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.py-course-player .py-player-btn:is(:hover,[aria-pressed=true],[aria-expanded=true]){color:#ffd54a;background:#ffffff16;border-color:#ffffff2b}
.py-course-player .py-player-btn:disabled{opacity:.4;cursor:default}.py-course-player :is(button,select,input,summary,[tabindex]):focus-visible{outline:2px solid #ffd54a;outline-offset:2px}
.py-player-chrome{position:absolute;z-index:4;inset:auto 0 0;padding:35px 12px 8px;background:linear-gradient(transparent,#020a15e8 52%);transition:opacity .18s ease;pointer-events:none}
.py-player-chrome>*{pointer-events:auto}.py-player-bar{display:flex;align-items:center;gap:5px;min-width:0}.py-player-time{font-variant-numeric:tabular-nums;font:500 12px/1.4 Vazirmatn,Tahoma,sans-serif;white-space:nowrap;margin-inline:5px auto;color:#fff}
.py-course-player input[type=range]{appearance:none;display:block;border:0;border-radius:8px;height:5px;min-height:5px;padding:0;margin:6px 0 11px;accent-color:#ffd54a;box-shadow:none;cursor:pointer;direction:ltr;background:#ffffff4d}
.py-course-player input[type=range]::-webkit-slider-thumb{appearance:none;width:13px;height:13px;border-radius:50%;background:#ffd54a;border:2px solid #fff;box-shadow:0 0 0 3px #0a162266}
.py-course-player input[type=range]::-moz-range-thumb{width:10px;height:10px;border-radius:50%;background:#ffd54a;border:2px solid #fff}
.py-course-player .py-player-seek{width:100%;background:linear-gradient(to right,#ffd54a var(--py-progress,0%),#ffffff4d var(--py-progress,0%))}
.py-course-player .py-player-volume{width:64px;flex:0 1 64px;margin:0 5px}.py-player-center{position:absolute;z-index:3;inset:0;display:flex;justify-content:center;align-items:center;gap:22px;pointer-events:none;transition:opacity .18s ease;opacity:0}
.py-player-center .py-player-btn{pointer-events:auto;position:relative;width:46px;height:46px;min-height:46px;background:#071426a8;backdrop-filter:blur(4px);border-color:#ffffff40;border-radius:50%}
.py-player-center .py-player-btn small{position:absolute;inset:19px 0 auto;text-align:center;font:500 9px/1 Vazirmatn,Tahoma,sans-serif}.py-player-center .py-player-btn svg{width:27px;height:27px}
.py-player-center .py-player-main-play{width:64px;height:64px;background:#ffcf45;color:#0b1e35;border-color:#ffe9a0}.py-player-main-play svg{fill:currentColor;stroke-width:1.2}
.py-player-paused .py-player-center,.py-course-player:hover:not(.py-player-idle) .py-player-center,.py-course-player:focus-within .py-player-center{opacity:1}
.py-course-player:not(.py-player-paused) .py-player-main-play{visibility:hidden}.py-player-idle .py-player-chrome,.py-player-idle .py-player-center{opacity:0;pointer-events:none}.py-player-idle .py-player-chrome *,.py-player-idle .py-player-center *{pointer-events:none}
.py-player-captions{position:absolute;z-index:2;left:7%;right:7%;bottom:var(--py-caption-bottom,7%);text-align:center;pointer-events:none;line-height:1.55;font-size:var(--py-caption-size,22px);color:var(--py-caption-color,#fff);text-shadow:0 1px 3px #000,0 0 4px #000}
.py-player-captions span{white-space:pre-line;overflow-wrap:anywhere;background:var(--py-caption-background,#030b17d9);padding:.1em .35em;border-radius:4px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.py-course-player:has(.py-player-chrome:hover) .py-player-captions,.py-player-paused .py-player-captions{bottom:max(var(--py-caption-bottom,7%),72px)}
.py-player-settings{position:absolute;z-index:6;right:12px;bottom:76px;width:min(390px,calc(100% - 24px));max-height:calc(100% - 92px);overflow:auto;overscroll-behavior:contain;padding:14px;border:1px solid #ffffff33;border-radius:14px;background:#101e32f5;color:#eef5ff;box-shadow:0 14px 36px #0008;scrollbar-width:thin;backdrop-filter:blur(14px)}
.py-player-settings-heading{position:sticky;top:-14px;z-index:2;background:#101e32;padding-bottom:4px;display:flex;align-items:center;justify-content:space-between;gap:10px}.py-player-settings-heading strong{font-size:14px;font-weight:600}.py-player-settings h3{font:600 13px/1.8 Vazirmatn,Tahoma,sans-serif!important;color:#fff!important;margin:12px 0 8px!important}
.py-player-settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.py-player-field{display:grid;gap:5px;margin-block:6px;color:#e5edf7;font-size:12px}.py-course-player .py-player-settings select{width:100%;max-width:100%;min-width:0;min-height:40px;font:400 12px/1.8 Vazirmatn,Tahoma,sans-serif;background:#192c45;color:#fff;border:1px solid #62738a;border-radius:8px;padding:5px 9px}
.py-player-language{display:grid!important;grid-template-columns:auto 1fr;align-items:center;gap:10px;color:#fff;font-size:12px;margin-bottom:10px}.py-player-language[hidden]{display:none!important}
.py-player-caption-fields{border:0;padding:0;margin:0;min-width:0}.py-player-caption-fields:disabled{opacity:.45}.py-player-range-field label{display:grid;grid-template-columns:1fr auto;gap:8px;font-size:12px;margin-top:7px}.py-player-range-field input{grid-column:1/-1;width:100%}.py-player-range-field output{direction:ltr;unicode-bidi:isolate;color:#ffd54a;font-variant-numeric:tabular-nums}
.py-player-modes{display:flex;gap:8px;margin-block:8px}.py-player-modes .py-player-btn{width:auto!important;height:auto;gap:6px;padding:7px!important;border-color:#ffffff30!important;flex:1;font-size:11px!important;line-height:1.5}
.py-course-player .py-player-settings .py-player-reset{width:100%;border:1px solid #ffd54a66;border-radius:8px;padding:8px 10px;background:#ffd54a15;color:#ffe19a;font:500 12px/1.7 Vazirmatn,Tahoma,sans-serif;cursor:pointer;margin-top:10px}
.py-player-tip,.py-player-help p{font:400 11px/1.9 Vazirmatn,Tahoma,sans-serif!important;color:#cbd8ea!important;margin-block:8px!important}.py-player-help{border-top:1px solid #ffffff26;margin-top:12px;padding-top:8px}.py-player-help summary{cursor:pointer;font-size:12px;color:#fff}
.py-player-notice{position:absolute;z-index:5;top:10px;left:10px;right:10px;margin:0!important;padding:8px 12px;border:1px solid #ffffff33;border-radius:8px;background:#101e32ed;color:#fff!important;font:400 12px/1.8 Vazirmatn,Tahoma,sans-serif!important;pointer-events:none}
.py-player-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.py-course-player.py-player-theater,.py-course-player:fullscreen{position:fixed!important;inset:0!important;z-index:99999;width:100vw!important;height:100dvh!important;max-width:none!important;aspect-ratio:auto!important;border-radius:0!important}
@media(max-width:600px){.py-player-bar{gap:2px}.py-course-player .py-player-btn{width:44px;height:44px;min-width:44px;min-height:44px}.py-course-player .py-player-extra,.py-course-player input.py-player-volume{display:none}.py-player-time{font-size:11px}.py-player-center{gap:16px}.py-player-center .py-player-main-play{width:54px;height:54px}.py-player-chrome{padding:28px 8px 6px}.py-player-settings{right:8px;bottom:68px;width:calc(100% - 16px);max-height:calc(100% - 78px);padding:10px}.py-player-settings-grid{gap:8px}}
@media(max-width:600px) and (orientation:portrait){.py-course-player:has(.py-player-settings:not([hidden])){min-height:370px}.py-course-player:has(.py-player-settings:not([hidden])) .py-player-center{display:none}}
@media(prefers-reduced-motion:reduce){.py-player-chrome,.py-player-center{transition:none}.py-player-settings{backdrop-filter:none}}

.py-course-player .py-player-delay-number{width:76px;min-height:30px;padding:3px 6px;border:1px solid #62738a;border-radius:6px;background:#192c45;color:#ffd54a;font:500 12px/1.5 Vazirmatn,Tahoma,sans-serif;direction:ltr;unicode-bidi:isolate}

/* Preserve contrast against both the video and the parent theme button reset. */
.py-course-player .py-player-center{direction:ltr}.py-course-player .py-player-center .py-player-btn{width:46px;height:46px;min-height:46px;padding:8px;background:#071426c9;color:#fff;border:1px solid #ffffff66;border-radius:50%;box-shadow:0 3px 14px #0004}.py-course-player .py-player-center .py-player-main-play{width:64px;height:64px;background:#ffd54a;color:#102a56;border-color:#ffe9a0}.py-course-player .py-player-center .py-player-main-play svg{fill:currentColor;stroke:currentColor}
@media(max-width:600px){.py-course-player .py-player-center .py-player-main-play{width:54px;height:54px}}

/* Isolate player controls from global form/select presentation. */
.py-course-player .py-player-settings label{color:#e5edf7;font:400 12px/1.7 Vazirmatn,Tahoma,sans-serif;text-align:start}
.py-course-player .py-player-settings label>span{color:#e5edf7}
.py-course-player .py-player-settings .py-player-field{display:grid;gap:5px;margin:6px 0}
.py-course-player .py-player-settings .py-player-range-field label{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:10px}
.py-course-player .py-player-settings .py-player-range-field label>span{font-size:12px}
.py-course-player .py-player-settings .py-player-language{display:grid;grid-template-columns:1fr;gap:5px;margin:6px 0 12px}
.py-course-player input[type=range]::-webkit-slider-runnable-track{height:5px;border:0;border-radius:8px;background:transparent;box-shadow:none}
.py-course-player input[type=range]::-moz-range-track{height:5px;border:0;border-radius:8px;background:transparent;box-shadow:none}
.py-course-player input[type=range]::-webkit-slider-thumb{margin-top:-4px}
.py-course-player .py-player-tabs{display:flex;gap:6px;padding:4px;margin:8px 0 12px;border-radius:10px;background:#030b176b}
.py-course-player .py-player-tab{flex:1;width:auto;min-height:38px;margin:0;padding:6px 12px;border:0;border-radius:7px;background:transparent;color:#cbd8ea;font:500 12px/1.7 Vazirmatn,Tahoma,sans-serif;cursor:pointer;box-shadow:none}
.py-course-player .py-player-tab[aria-selected=true]{background:#ffd54a;color:#102a56}
.py-course-player.py-player-settings-open .py-player-center{visibility:hidden}
.py-course-player:not(.py-player-idle) .py-player-captions{bottom:max(var(--py-caption-bottom,7%),76px)}
.py-course-player .py-player-settings{scrollbar-color:#6b7b91 #101e32}
@media(max-width:600px){.py-course-player .py-player-tab{min-height:44px}.py-course-player .py-player-settings{max-height:calc(100% - 80px)}}

.py-course-player .py-player-caption-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.py-course-player .py-player-caption-fields>.py-player-delay,.py-course-player .py-player-caption-fields>.py-player-settings-grid,.py-course-player .py-player-caption-fields>.py-player-reset{grid-column:1/-1}
.py-course-player .py-player-settings .py-player-range-field label{align-items:center}.py-course-player .py-player-settings .py-player-range-field input[type=range]{margin:5px 0 10px}
.py-media-preview:has(.py-course-player) [data-preview-files]{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:8px}
.py-media-preview:has(.py-course-player) .py-media-preview-file{display:flex;min-width:0}.py-media-preview:has(.py-course-player) .py-media-preview-file button{width:100%;min-height:42px;font-size:12px}

/* The site palette uses a #page form rule; media controls retain a fixed accessible contrast. */
.py-course-player .py-player-settings :is(select,input[type=number]){background:#192c45!important;color:#f5f8ff!important;border:1px solid #62738a!important;box-shadow:none!important}

/* Solid surfaces avoid compositor blur leaking onto adjacent controls on small screens. */
.py-course-player .py-player-settings{background:#101e32;backdrop-filter:none}
.py-course-player .py-player-center .py-player-btn{backdrop-filter:none}
.py-media-preview:has(.py-course-player)>header{position:sticky;top:0;z-index:8;background:var(--py-c-surface,#fff);padding-block:6px}

/* Editorial credit has a protected rail on small stages; subtitles/transport always win. */
.py-course-player .py-player-credit{position:absolute;z-index:2;top:8px;left:8px;right:auto;display:flex;align-items:center;gap:7px;max-width:calc(100% - 16px);width:max-content;padding:6px 10px;border:1px solid #ffffff40;border-radius:10px;background:#07162cec;color:#fff;font:400 12px/1.65 Vazirmatn,Tahoma,sans-serif;text-align:start;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease;box-shadow:0 3px 12px #0003}
.py-course-player .py-player-credit.is-shown{opacity:var(--py-credit-opacity,.85);visibility:visible}.py-course-player .py-player-credit[data-position=top-right]{left:auto;right:8px}.py-player-credit bdi{min-width:0;unicode-bidi:isolate;overflow-wrap:anywhere}.py-player-credit svg{flex:none;width:18px;height:18px;fill:none;stroke:#ffd54a;stroke-width:1.7}
.py-course-player.py-credit-rail{aspect-ratio:auto!important;padding-top:var(--py-credit-reserve,48px)}.py-credit-rail video{height:auto;aspect-ratio:var(--py-video-aspect,16 / 9)}.py-credit-rail .py-player-center{top:var(--py-credit-reserve,48px)}.py-credit-rail .py-player-credit{font-size:11px;padding:5px 8px}
@media(prefers-reduced-motion:reduce){.py-course-player .py-player-credit{transition:none}}

/* In a short mobile stage, duplicate center controls can cover two subtitle lines.
   Keep the transport bar available; restore center controls when captions disappear. */
@media(max-width:640px){.py-course-player:has(.py-player-captions:not([hidden])) .py-player-center{display:none}}

/* Native dialog max-width depends on inherited em size; keep 44px controls inside narrow phones. */
@media(max-width:359px){:is(.py-media-dialog,.py-media-preview):has(.py-course-player){max-width:calc(100% - 12px);padding:8px}}

/* Keep direct CC language switching reachable with 44px touch targets on phones. */
@media(max-width:600px){.py-player-bar{display:grid;grid-template-columns:repeat(5,minmax(44px,1fr));gap:2px}.py-player-bar>.py-player-btn{justify-self:center}.py-player-time{grid-row:1;grid-column:1/-1;text-align:center;margin:0;line-height:1.4}.py-course-player:not(.py-player-idle) .py-player-captions{bottom:max(var(--py-caption-bottom,7%),100px)}}

/* A short inline phone frame cannot share its caption space with transport.
   Grid keeps the original video ratio, gives long cues room and leaves touch
   controls in their own row. Fullscreen/theater retain the overlay layout. */
@media(max-width:600px){
  .py-course-player:not(:fullscreen):not(.py-player-theater){display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(min-content,1fr) auto;aspect-ratio:auto!important}
  .py-course-player:not(:fullscreen):not(.py-player-theater) video{grid-area:1 / 1;width:100%;height:auto;aspect-ratio:var(--py-video-aspect,16 / 9);align-self:center}
  .py-course-player:not(:fullscreen):not(.py-player-theater) .py-player-captions{grid-area:1 / 1;position:relative;inset:auto!important;align-self:end;min-width:0;margin:8px 5% var(--py-caption-bottom,7%);font-size:clamp(14px,calc(var(--py-caption-size,22px) * .75),28.5px);line-height:1.45}
  .py-course-player:not(:fullscreen):not(.py-player-theater) .py-player-chrome{grid-area:2 / 1;position:relative;inset:auto;padding:8px 8px 6px;background:#071426;opacity:1;pointer-events:auto}
  .py-course-player:not(:fullscreen):not(.py-player-theater) .py-player-chrome *{pointer-events:auto}
  .py-course-player:not(:fullscreen):not(.py-player-theater) .py-player-center{grid-area:1 / 1;position:relative;inset:auto;align-self:center;justify-self:center}
  .py-course-player:not(:fullscreen):not(.py-player-theater) .py-player-settings{grid-area:1 / 1 / 2 / 2;inset:8px;width:auto;max-height:calc(100% - 16px)}
}

/* Settings stay on their own high-contrast palette in every interaction state. */
:is(.py-media-dialog,.py-media-preview) .py-course-player{font-family:var(--py-font,Vazirmatn,Tahoma,sans-serif)}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-settings :is(select,input[type=number]){color-scheme:dark;min-height:44px;background-color:#192c45!important;color:#f5f8ff!important;border-color:#62738a!important;box-shadow:none!important}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-settings :is(select,input[type=number]):is(:hover,:focus,:active){background-color:#233d5d!important;color:#fff!important;border-color:#9cb6d7!important}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-settings option{background-color:#192c45;color:#f5f8ff}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-settings .py-player-tab{background:transparent;color:#cbd8ea;border:1px solid transparent;box-shadow:none}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-settings .py-player-tab:is(:hover,:focus-visible){background:#263f5d;color:#fff;border-color:#62738a}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-settings .py-player-tab[aria-selected=true]{background:#ffd54a;color:#102a56;border-color:#ffd54a}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-settings .py-player-btn:is(:hover,:focus-visible,[aria-pressed=true]){background:#263f5d;color:#ffe19a;border-color:#8a9eb8}
:is(.py-media-dialog,.py-media-preview) .py-course-player .py-player-settings .py-player-reset:is(:hover,:focus-visible){background:#ffd54a26;color:#ffe9b3;border-color:#ffe19a}

/* A Document PiP carries the same player/caption nodes, with local styles/fonts.
   Its transport has a separate row so captions never sit behind the controls. */
html.py-player-pip-page,body.py-player-pip-page{width:100%;height:100%;margin:0;padding:0;overflow:hidden;background:#030b17;color:#fff}
.py-player-pip-placeholder{display:grid;place-content:center;justify-items:center;gap:14px;width:100%;min-height:160px;padding:20px;box-sizing:border-box;border:1px solid #62738a;border-radius:4px;background:#071426;color:#eef5ff;text-align:center;font:400 14px/1.9 Vazirmatn,Tahoma,sans-serif}
.py-player-pip-placeholder p{margin:0}.py-player-pip-placeholder button{padding:8px 14px;min-height:44px;border:1px solid #ffd54a;border-radius:4px;background:#ffd54a;color:#102a56;font:500 13px/1.8 Vazirmatn,Tahoma,sans-serif;cursor:pointer}
.py-player-pip-placeholder button:focus-visible{outline:2px solid #fff;outline-offset:3px}
.py-course-player.py-player-document-pip{display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto!important;width:100%!important;height:100dvh!important;min-height:0!important;max-height:none;aspect-ratio:auto!important;padding:0!important;border-radius:0}
.py-course-player.py-player-document-pip video{grid-area:1 / 1;width:100%;height:100%!important;min-height:0;aspect-ratio:auto!important;align-self:stretch}
.py-course-player.py-player-document-pip .py-player-captions{grid-area:1 / 1;position:relative;inset:auto!important;align-self:end;min-width:0;margin:6px 5% max(8px,var(--py-caption-bottom,7%));font-size:clamp(14px,calc(var(--py-caption-size,22px) * .8),30px);line-height:1.45}
.py-course-player.py-player-document-pip .py-player-chrome{grid-area:2 / 1;position:relative;inset:auto;padding:6px 8px;background:#071426;opacity:1;pointer-events:auto}
.py-course-player.py-player-document-pip .py-player-chrome *{pointer-events:auto}
.py-course-player.py-player-document-pip .py-player-center{grid-area:1 / 1;position:relative;inset:auto;align-self:center;justify-self:center}
.py-course-player.py-player-document-pip .py-player-settings{grid-area:1 / 1 / 3 / 2;inset:6px;width:auto;max-height:calc(100% - 12px);min-height:0}
.py-course-player.py-player-document-pip :is(.py-player-fullscreen-toggle,.py-player-theater-toggle){display:none!important}
.py-course-player.py-player-document-pip .py-player-pip-toggle{display:inline-flex!important}
.py-course-player.py-player-document-pip .py-player-credit{top:6px;font-size:11px;line-height:1.45;border-radius:4px}
