/* Shared presentation viewer. Scoped to avoid changing the existing site. */
.kun-presentation-card {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 86px;
  padding: 12px; border: 1px solid #3356a3; border-radius: 14px;
  background: linear-gradient(120deg, #002855, #1e40af); color: #fff;
  box-shadow: 0 10px 24px -12px #1e40af80; text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.kun-presentation-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px #1e40af80; }
.kun-presentation-card__cover { position: relative; flex: 0 0 86px; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid #ffffff45; border-radius: 7px; background: #fff; }
.kun-presentation-card__cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.kun-presentation-card__play { position: absolute; inset: 0; display: grid; place-items: center; background: #00285533; }
.kun-presentation-card__play svg { width: 27px; height: 27px; padding: 6px; border-radius: 50%; color: #002855; background: #fff; box-shadow: 0 2px 8px #00285550; }
.kun-presentation-card__copy { display: grid; gap: 5px; text-align: left; }
.kun-presentation-card__copy strong { font-size: 12px; line-height: 1.5; font-weight: 800; }
.kun-presentation-card__copy small { color: #dbeafe; font-size: 10px; line-height: 1.5; }
.kun-presentation-card:focus-visible { outline: 3px solid #CB333B; outline-offset: 4px; }

.kun-presentation {
  position: fixed; inset: 0; width: min(1280px, calc(100vw - 48px));
  height: min(900px, calc(100dvh - 48px)); max-width: none; max-height: none;
  margin: auto; padding: 0; overflow: hidden; border: 1px solid #ffffff26;
  border-radius: 22px; background: #091628; color: #fff;
  box-shadow: 0 32px 120px #0008; font-family: Inter, sans-serif;
  color-scheme: dark;
}
.kun-presentation[open] { display: block; animation: kun-presentation-open .2s ease-out; }
.kun-presentation__surface { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-height: 0; background: #091628; }
.kun-presentation::backdrop { background: #020a18d9; backdrop-filter: blur(10px); }
.kun-presentation [hidden] { display: none !important; }
.kun-presentation__header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid #ffffff15; }
.kun-presentation__eyebrow { margin: 0 0 5px; font-size: 9px; font-weight: 700; letter-spacing: .16em; color: #c0d2ed; text-transform: uppercase; }
.kun-presentation__title { margin: 0; font-family: 'Plus Jakarta Sans', Inter, sans-serif; font-size: clamp(15px, 2vw, 21px); font-weight: 800; line-height: 1.4; }
.kun-presentation__tools { display: flex; gap: 8px; flex-shrink: 0; }
.kun-presentation button { font: inherit; cursor: pointer; }
.kun-presentation__button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 44px; height: 44px; padding: 10px; border: 1px solid #ffffff26; border-radius: 12px; background: #ffffff09; color: #fff; transition: background .15s, border-color .15s; }
.kun-presentation__button:hover { background: #ffffff1a; border-color: #ffffff50; }
.kun-presentation__button:focus-visible, .kun-presentation a:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.kun-presentation__button svg { width: 20px; height: 20px; flex-shrink: 0; }
.kun-presentation__close { background: #CB333B; border-color: #CB333B; }
.kun-presentation__close:hover { background: #b3262e; }
.kun-presentation__body { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 12px; align-items: center; min-height: 0; padding: 20px; }
.kun-presentation__stage { position: relative; display: grid; place-items: center; height: 100%; min-height: 0; overflow: hidden; border-radius: 10px; background: #06101e; touch-action: pan-y pinch-zoom; }
.kun-presentation__image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; opacity: 0; transition: opacity .22s ease; user-select: none; }
.kun-presentation__image.is-ready { opacity: 1; }
.kun-presentation__button[aria-disabled="true"] { opacity: .3; cursor: default; }
.kun-presentation__loading, .kun-presentation__error { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; padding: 24px; text-align: center; font-size: 13px; line-height: 1.6; color: #cbd5e1; }
.kun-presentation__loading::before { content: ''; width: 32px; height: 32px; border: 3px solid #ffffff25; border-top-color: #fff; border-radius: 50%; animation: kun-presentation-spin .8s linear infinite; }
.kun-presentation__retry { width: auto; padding-inline: 16px; }
.kun-presentation__footer { padding: 0 24px 18px; }
.kun-presentation__caption { max-height: 88px; overflow-y: auto; margin: 0 0 16px; color: #d3dfef; font-size: 12px; line-height: 1.7; scrollbar-width: thin; }
.kun-presentation__controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 1px solid #ffffff15; }
.kun-presentation__position { display: flex; align-items: center; gap: 16px; }
.kun-presentation__counter { min-width: 48px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kun-presentation__progress { display: block; width: 100px; height: 3px; overflow: hidden; border-radius: 4px; background: #ffffff20; }
.kun-presentation__progress span { display: block; height: 100%; background: #CB333B; transition: width .2s; }
.kun-presentation__actions { display: flex; align-items: center; gap: 14px; }
.kun-presentation__download { font-size: 11px; color: #c0d2ed; text-decoration: underline; text-underline-offset: 4px; }
.kun-presentation__autoplay { width: auto; padding-inline: 12px; font-size: 11px !important; }
.kun-presentation__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.kun-presentation__surface:fullscreen { width: 100vw; height: 100dvh; border: 0; border-radius: 0; color: #fff; }
@keyframes kun-presentation-spin { to { transform: rotate(360deg); } }
@keyframes kun-presentation-open { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .kun-presentation { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .kun-presentation__header { padding: max(14px, env(safe-area-inset-top)) 14px 14px; gap: 8px; }
  .kun-presentation__eyebrow { font-size: 8px; letter-spacing: .08em; }
  .kun-presentation__tools { gap: 6px; }
  .kun-presentation__body { position: relative; display: block; padding: 10px 10px 64px; }
  .kun-presentation__stage { width: 100%; }
  .kun-presentation__prev, .kun-presentation__next { position: absolute; bottom: 10px; }
  .kun-presentation__prev { left: calc(50% - 54px); }
  .kun-presentation__next { right: calc(50% - 54px); }
  .kun-presentation__footer { padding: 0 14px max(14px, env(safe-area-inset-bottom)); }
  .kun-presentation__caption { max-height: 112px; margin-bottom: 10px; font-size: 12px; }
  .kun-presentation__controls { gap: 8px; padding-top: 10px; }
  .kun-presentation__progress { width: 36px; }
  .kun-presentation__position { gap: 8px; }
  .kun-presentation__actions { gap: 10px; }
  .kun-presentation__autoplay span { display: none; }
  .kun-presentation__autoplay { width: 44px; padding: 10px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .kun-presentation__header { padding: 8px 16px; }
  .kun-presentation__eyebrow, .kun-presentation__caption { display: none; }
  .kun-presentation__body { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; padding: 8px 16px; }
  .kun-presentation__prev, .kun-presentation__next { position: static; }
  .kun-presentation__footer { padding: 0 16px 8px; }
  .kun-presentation__controls { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .kun-presentation, .kun-presentation *, .kun-presentation-card { animation: none !important; transition: none !important; }
}
