.pcfs-widget {
    --pcfs-width: 320px; --pcfs-mobile-width: 248px; --pcfs-x: 24px; --pcfs-y: 24px;
    --pcfs-mobile-y: 18px; --pcfs-accent: #0E4C7B; --pcfs-ratio: 16 / 9; --pcfs-fit: cover; --pcfs-mobile-scale: .67;
    position: fixed !important; bottom: max(8px, min(calc(var(--pcfs-y) + env(safe-area-inset-bottom, 0px)), 25vh));
    z-index: 99990; width: var(--pcfs-width); max-width: calc(100vw - 32px);
    color: #202b28; font: 400 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    text-align: left; letter-spacing: normal; text-transform: none; isolation: isolate;
    margin: 0; padding: 0; border: 0; background: none;
}
.pcfs-widget.pcfs-position-left { left: min(var(--pcfs-x), 8vw); right: auto; }
.pcfs-widget.pcfs-position-right { right: min(var(--pcfs-x), 8vw); left: auto; }
.pcfs-widget, .pcfs-widget * { box-sizing: border-box; }
.pcfs-widget[hidden], .pcfs-widget [hidden] { display: none !important; }
.pcfs-widget p { margin: 0; padding: 0; }
.pcfs-widget button, .pcfs-widget a { font: inherit; letter-spacing: normal; text-transform: none; }
.pcfs-widget button::before, .pcfs-widget button::after, .pcfs-widget a::before, .pcfs-widget a::after { content: none; }
.pcfs-widget button {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 0; margin: 0; cursor: pointer; box-shadow: none; min-width: 0; min-height: 0;
    -webkit-tap-highlight-color: transparent; background-image: none;
}
.pcfs-widget button:focus-visible, .pcfs-widget a:focus-visible { outline: 3px solid #d8ab58; outline-offset: -3px; }
.pcfs-widget button:disabled { opacity: .3; cursor: default; }
.pcfs-widget .pcfs-card {
    background: #fff; border: 1px solid rgba(24, 52, 41, .14); border-radius: 16px; overflow: auto;
    max-height: calc(100vh - 32px - min(var(--pcfs-y), 25vh));
    max-height: calc(100dvh - 32px - min(var(--pcfs-y), 25dvh));
    box-shadow: 0 12px 40px rgba(18, 37, 29, .19), 0 2px 8px rgba(18, 37, 29, .08);
    animation: pcfs-enter .3s ease both;
}
.pcfs-widget .pcfs-head { display: flex; align-items: center; gap: 3px; padding: 11px 10px 10px 15px; background: #fcfbf7; }
.pcfs-widget .pcfs-heading { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pcfs-widget .pcfs-kicker { font-size: 9px; font-weight: 700; letter-spacing: 1.15px; color: var(--pcfs-accent); }
.pcfs-widget .pcfs-heading-title { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcfs-widget .pcfs-icon-button { width: 32px; height: 32px; border-radius: 8px; padding: 0; color: #364740; background: transparent; line-height: 1; }
.pcfs-widget .pcfs-icon-button > span:not(.pcfs-button-text) { font-size: 22px; line-height: 1; font-weight: 400; }
.pcfs-widget .pcfs-icon-button:hover:not(:disabled) { color: var(--pcfs-accent); background: #eaf1ed; }
.pcfs-widget .pcfs-stage { position: relative; background: #15251f; overflow: hidden; }
.pcfs-widget .pcfs-media { aspect-ratio: var(--pcfs-ratio); position: relative; width: 100%; max-height: 50vh; max-height: 50dvh; }
.pcfs-widget.pcfs-fit-blur .pcfs-media { overflow: hidden; isolation: isolate; background: #17221e; }
.pcfs-widget.pcfs-fit-blur .pcfs-media::before {
    content: ""; position: absolute; inset: -12%; z-index: 0; pointer-events: none;
    background-image: var(--pcfs-backdrop, none); background-size: cover; background-position: center;
    filter: blur(18px) saturate(.9); transform: scale(1.08); opacity: .68;
}
.pcfs-widget.pcfs-fit-blur .pcfs-media::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: rgba(10, 18, 15, .16);
}
.pcfs-widget.pcfs-fit-blur .pcfs-media img,
.pcfs-widget.pcfs-fit-blur .pcfs-media video { object-fit: contain; }
.pcfs-widget .pcfs-media img, .pcfs-widget .pcfs-media video {
    display: block; position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
    margin: 0; padding: 0; border: 0; border-radius: 0; object-fit: var(--pcfs-fit); box-shadow: none;
}
.pcfs-widget .pcfs-badge { display: none !important; }
.pcfs-widget .pcfs-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; border-radius: 30px; background: #fff; color: #203d31; padding: 10px 16px; z-index: 2; font-size: 12px; font-weight: 600; }
.pcfs-widget .pcfs-message { position: absolute; inset: auto 12px 13px; padding: 8px 10px; background: rgba(12, 21, 17, .88); color: #fff; border-radius: 6px; font-size: 11px; text-align: center; pointer-events: none; }
.pcfs-widget .pcfs-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: rgba(255, 255, 255, .2); }
.pcfs-widget .pcfs-progress span { display: block; width: 0; height: 100%; background: #d9c795; }
.pcfs-widget .pcfs-info { padding: 12px 15px 7px; }
.pcfs-widget .pcfs-project-title { display: none !important; font-size: 14px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcfs-widget .pcfs-caption { font-size: 11px; line-height: 1.5; margin-top: 4px; color: #68776f; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcfs-widget .pcfs-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; padding: 3px 0; color: var(--pcfs-accent); text-decoration: none; font-size: 11px; font-weight: 650; }
.pcfs-widget .pcfs-link:hover { text-decoration: underline; }
.pcfs-widget .pcfs-controls { display: flex; justify-content: space-between; align-items: center; padding: 0 9px 8px; }
.pcfs-widget .pcfs-nav, .pcfs-widget .pcfs-actions { display: flex; align-items: center; gap: 3px; }
.pcfs-widget .pcfs-count { min-width: 44px; text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; color: #748078; }
.pcfs-widget .pcfs-sound { width: auto; min-width: 52px; padding: 0 7px; }
.pcfs-widget .pcfs-button-text { font-size: 10px; }
.pcfs-widget.pcfs-collapsed { width: auto; }
.pcfs-widget .pcfs-launcher { gap: 8px; max-width: calc(100vw - 32px); padding: 9px 12px 9px 9px; border-radius: 30px; background: #fff; color: #223c31; border: 1px solid #e0e7e0; box-shadow: 0 5px 25px rgba(18, 37, 29, .17); font-size: 11px; font-weight: 600; }
.pcfs-widget .pcfs-launcher > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcfs-widget .pcfs-launcher-play { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--pcfs-accent); color: #fff; font-size: 9px; }
.pcfs-widget .pcfs-launcher-count { color: #6f7a74; font-size: 10px; }
@keyframes pcfs-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
    .pcfs-widget { width: calc(var(--pcfs-mobile-width) * var(--pcfs-mobile-scale)); bottom: max(8px, min(calc(var(--pcfs-mobile-y) + env(safe-area-inset-bottom, 0px)), 25vh)); max-width: calc(100vw - 24px); }
    .pcfs-widget.pcfs-position-left { left: max(12px, env(safe-area-inset-left, 0px)); }
    .pcfs-widget.pcfs-position-right { right: max(12px, env(safe-area-inset-right, 0px)); }
    .pcfs-widget.pcfs-collapsed { width: auto; }
    .pcfs-widget .pcfs-card { max-height: calc(100vh - 32px - min(var(--pcfs-mobile-y), 25vh)); max-height: calc(100dvh - 32px - min(var(--pcfs-mobile-y), 25dvh)); border-radius: 13px; }
    .pcfs-widget .pcfs-head { padding: 7px 6px 7px 12px; }
    .pcfs-widget .pcfs-heading-title { font-size: 12px; }
    .pcfs-widget .pcfs-kicker { font-size: 8px; letter-spacing: .7px; }
    .pcfs-widget .pcfs-icon-button { width: 36px; height: 36px; }
    .pcfs-widget .pcfs-info { padding: 10px 12px 5px; }
    .pcfs-widget .pcfs-project-title { font-size: 12px; }
    .pcfs-widget .pcfs-controls { padding-bottom: 5px; }
    .pcfs-widget .pcfs-sound { width: auto; }
    .pcfs-widget .pcfs-launcher { max-width: 160px; gap: 6px; padding: 7px 9px 7px 7px; font-size: 10.5px; }
    .pcfs-widget .pcfs-launcher-play { width: 24px; height: 24px; font-size: 8px; }
    .pcfs-widget .pcfs-launcher-count { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { .pcfs-widget .pcfs-card { animation: none; } }

/* Adaptive portrait video layout. The widget keeps the configured width for
   images/landscape media, but portrait videos may narrow so their true ratio
   remains fully visible within the viewport. */
.pcfs-widget { transition: width .34s cubic-bezier(.22,.61,.36,1); }
.pcfs-widget.pcfs-video-portrait { width: var(--pcfs-dynamic-width, var(--pcfs-width)); }
.pcfs-widget.pcfs-video-portrait .pcfs-media { max-height: none; }
.pcfs-widget .pcfs-media { transition: aspect-ratio .34s cubic-bezier(.22,.61,.36,1); }
@media (max-width: 600px) {
    .pcfs-widget.pcfs-video-portrait { width: calc(var(--pcfs-dynamic-width, var(--pcfs-mobile-width)) * var(--pcfs-mobile-scale)); }
}

@media print { .pcfs-widget { display: none !important; } }

/* Slide transition effects */
.pcfs-widget {
    --pcfs-transition-speed: 600ms;
    --pcfs-image-interval: 5000ms;
}
.pcfs-widget .pcfs-current-media {
    z-index: 1;
    transform-origin: center center;
    will-change: opacity, transform;
    backface-visibility: hidden;
}
.pcfs-widget .pcfs-pending-media {
    opacity: 0;
    pointer-events: none;
}
.pcfs-widget .pcfs-transition-enter,
.pcfs-widget .pcfs-transition-exit {
    pointer-events: none;
}
.pcfs-widget .pcfs-transition-enter { z-index: 2; }
.pcfs-widget .pcfs-transition-exit { z-index: 1; }

/* Fade: genuine crossfade between outgoing and incoming media. */
.pcfs-widget .pcfs-enter-fade { animation: pcfs-crossfade-in var(--pcfs-transition-speed) ease both; }
.pcfs-widget .pcfs-exit-fade { animation: pcfs-crossfade-out var(--pcfs-transition-speed) ease both; }

/* Slide: both layers move through the frame, rather than replacing instantly. */
.pcfs-widget .pcfs-enter-slide-left { animation: pcfs-slide-left-in var(--pcfs-transition-speed) cubic-bezier(.22,.61,.36,1) both; }
.pcfs-widget .pcfs-exit-slide-left { animation: pcfs-slide-left-out var(--pcfs-transition-speed) cubic-bezier(.22,.61,.36,1) both; }
.pcfs-widget .pcfs-enter-slide-right { animation: pcfs-slide-right-in var(--pcfs-transition-speed) cubic-bezier(.22,.61,.36,1) both; }
.pcfs-widget .pcfs-exit-slide-right { animation: pcfs-slide-right-out var(--pcfs-transition-speed) cubic-bezier(.22,.61,.36,1) both; }

/* Zoom: incoming media settles in while the outgoing layer recedes. */
.pcfs-widget .pcfs-enter-zoom { animation: pcfs-zoom-in var(--pcfs-transition-speed) cubic-bezier(.2,.7,.2,1) both; }
.pcfs-widget .pcfs-exit-zoom { animation: pcfs-zoom-out var(--pcfs-transition-speed) ease both; }

/* Ken Burns uses a soft crossfade, then continues a slow cinematic move. */
.pcfs-widget .pcfs-enter-kenburns { animation: pcfs-crossfade-in var(--pcfs-transition-speed) ease both; }
.pcfs-widget .pcfs-exit-kenburns { animation: pcfs-crossfade-out var(--pcfs-transition-speed) ease both; }
.pcfs-widget .pcfs-kenburns-active { animation: pcfs-kenburns-motion var(--pcfs-image-interval) ease-out both; }

.pcfs-widget .pcfs-enter-none,
.pcfs-widget .pcfs-exit-none { animation: none; }
.pcfs-widget .pcfs-exit-none { opacity: 0; }

@keyframes pcfs-crossfade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pcfs-crossfade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pcfs-slide-left-in { from { opacity: .88; transform: translate3d(100%,0,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
@keyframes pcfs-slide-left-out { from { opacity: 1; transform: translate3d(0,0,0); } to { opacity: .72; transform: translate3d(-100%,0,0); } }
@keyframes pcfs-slide-right-in { from { opacity: .88; transform: translate3d(-100%,0,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
@keyframes pcfs-slide-right-out { from { opacity: 1; transform: translate3d(0,0,0); } to { opacity: .72; transform: translate3d(100%,0,0); } }
@keyframes pcfs-zoom-in { from { opacity: 0; transform: scale(1.075); } to { opacity: 1; transform: scale(1); } }
@keyframes pcfs-zoom-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.965); } }
@keyframes pcfs-kenburns-motion { from { transform: scale(1.015) translate3d(0,0,0); } to { transform: scale(1.09) translate3d(-1.5%,-1%,0); } }

@media (prefers-reduced-motion: reduce) {
    .pcfs-widget:not([data-pcfs-force-motion="1"]) .pcfs-current-media { animation: none !important; transform: none !important; }
}
