.em-synced-media-panel {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 980px);
    margin: 0 auto 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: #11151b;
    color: #fff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.32);
}

.em-synced-media-panel[hidden] { display: none !important; }

.em-synced-media-panel.is-audio-runtime-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    pointer-events: none !important;
}

.em-synced-audio-status,
.em-synced-media-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

.em-synced-count-in-anchor { position: relative; }

.em-synced-count-in-card {
    position: absolute;
    z-index: 1750;
    top: clamp(18px, 9vh, 92px);
    left: 50%;
    display: grid;
    min-width: 150px;
    place-items: center;
    padding: 14px 22px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    color: #fff;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    pointer-events: none;
    transform: translateX(-50%);
    animation: em-synced-count-in-enter 160ms ease-out;
}

.em-synced-count-in-card[hidden] { display: none !important; }

.em-synced-count-in-title {
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.em-synced-count-in-number {
    margin: 1px 0;
    color: #fff;
    font-size: clamp(42px, 7vw, 64px);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    line-height: 1;
}

.em-synced-count-in-progress {
    color: #dbeafe;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.em-synced-count-in-card.is-paused {
    opacity: 0.72;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
}

@keyframes em-synced-count-in-enter {
    from { opacity: 0; transform: translate(-50%, -8px) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.em-synced-media-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    overflow: hidden;
    background: #05070a;
}

.em-synced-media-panel.is-pip-floating {
    position: fixed;
    z-index: 1700;
    max-width: calc(100vw - 32px);
    margin: 0;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    will-change: left, top, width, height;
}

.phonicscore-opensheetmusicdisplay__placeholder.em-feedback-modes-open .em-synced-media-panel.is-pip-floating,
.phonicscore-opensheetmusicdisplay__placeholder.em-feedback-settings-open .em-synced-media-panel.is-pip-floating,
.phonicscore-opensheetmusicdisplay__placeholder.em-synced-source-open .em-synced-media-panel.is-pip-floating {
    z-index: 480;
}

.phonicscore-opensheetmusicdisplay__placeholder.em-feedback-modes-open .em-synced-count-in-card,
.phonicscore-opensheetmusicdisplay__placeholder.em-feedback-settings-open .em-synced-count-in-card,
.phonicscore-opensheetmusicdisplay__placeholder.em-synced-source-open .em-synced-count-in-card {
    z-index: 490;
}

.phonicscore-opensheetmusicdisplay__placeholder:fullscreen.em-feedback-modes-open .em-synced-media-panel.is-pip-floating,
.phonicscore-opensheetmusicdisplay__placeholder:fullscreen.em-feedback-settings-open .em-synced-media-panel.is-pip-floating,
.phonicscore-opensheetmusicdisplay__placeholder:fullscreen.em-synced-source-open .em-synced-media-panel.is-pip-floating,
.phonicscore-opensheetmusicdisplay__placeholder.em-is-fullscreen.em-feedback-modes-open .em-synced-media-panel.is-pip-floating,
.phonicscore-opensheetmusicdisplay__placeholder.em-is-fullscreen.em-feedback-settings-open .em-synced-media-panel.is-pip-floating,
.phonicscore-opensheetmusicdisplay__placeholder.em-is-fullscreen.em-synced-source-open .em-synced-media-panel.is-pip-floating {
    z-index: 780;
}

.phonicscore-opensheetmusicdisplay__placeholder:fullscreen.em-feedback-modes-open .em-synced-count-in-card,
.phonicscore-opensheetmusicdisplay__placeholder:fullscreen.em-feedback-settings-open .em-synced-count-in-card,
.phonicscore-opensheetmusicdisplay__placeholder:fullscreen.em-synced-source-open .em-synced-count-in-card,
.phonicscore-opensheetmusicdisplay__placeholder.em-is-fullscreen.em-feedback-modes-open .em-synced-count-in-card,
.phonicscore-opensheetmusicdisplay__placeholder.em-is-fullscreen.em-feedback-settings-open .em-synced-count-in-card,
.phonicscore-opensheetmusicdisplay__placeholder.em-is-fullscreen.em-synced-source-open .em-synced-count-in-card {
    z-index: 790;
}

.em-synced-media-panel.is-pip-floating .em-synced-media-stage {
    height: 100%;
    aspect-ratio: auto;
}

.em-synced-media-panel.is-pip-docked {
    max-width: calc(100% - 24px);
    aspect-ratio: auto;
}

.em-synced-media-panel.is-pip-interacting {
    user-select: none;
    box-shadow: 0 22px 58px rgba(15, 23, 42, 0.45);
}

.em-synced-pip-drag-handle {
    position: absolute;
    z-index: 8;
    top: 6px;
    left: 50%;
    display: grid;
    width: 46px;
    height: 24px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    cursor: grab;
    touch-action: none;
    transform: translateX(-50%);
}

.em-synced-pip-drag-handle span,
.em-synced-pip-drag-handle span::before,
.em-synced-pip-drag-handle span::after {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
}

.em-synced-pip-drag-handle span { position: relative; }
.em-synced-pip-drag-handle span::before,
.em-synced-pip-drag-handle span::after { position: absolute; top: 0; content: ''; }
.em-synced-pip-drag-handle span::before { left: -8px; }
.em-synced-pip-drag-handle span::after { right: -8px; }
.em-synced-pip-drag-handle:active { cursor: grabbing; }
.em-synced-pip-drag-handle:focus-visible { outline: 3px solid #72aee6; outline-offset: 2px; }
.em-synced-media-panel.is-pip-docked .em-synced-pip-drag-handle { cursor: default; }

.em-synced-pip-resize {
    position: absolute;
    z-index: 9;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    touch-action: none;
}

.em-synced-pip-resize::after {
    position: absolute;
    width: 9px;
    height: 9px;
    border-color: rgba(255, 255, 255, 0.86);
    border-style: solid;
    content: '';
    filter: drop-shadow(0 1px 2px #000);
}

.em-synced-pip-resize.is-nw { top: 0; left: 0; cursor: nwse-resize; }
.em-synced-pip-resize.is-ne { top: 0; right: 0; cursor: nesw-resize; }
.em-synced-pip-resize.is-se { right: 0; bottom: 0; cursor: nwse-resize; }
.em-synced-pip-resize.is-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.em-synced-pip-resize.is-nw::after { top: 5px; left: 5px; border-width: 2px 0 0 2px; }
.em-synced-pip-resize.is-ne::after { top: 5px; right: 5px; border-width: 2px 2px 0 0; }
.em-synced-pip-resize.is-se::after { right: 5px; bottom: 5px; border-width: 0 2px 2px 0; }
.em-synced-pip-resize.is-sw::after { bottom: 5px; left: 5px; border-width: 0 0 2px 2px; }

.em-synced-media-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.em-synced-media-player iframe { width: 100%; height: 100%; min-width: 0; min-height: 0; border: 0; }
.em-synced-media-player audio { width: min(94%, 760px); }

.em-synced-provider-mount {
    box-sizing: border-box;
    flex: 1 1 100%;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.em-synced-provider-mount.is-vimeo > div {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
}

.em-synced-provider-mount.is-vimeo iframe {
    position: absolute;
    inset: 0;
}

.em-synced-youtube-poster {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    padding: 0;
    border: 0;
    background: #05070a;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
}

.em-synced-youtube-poster[hidden] { display: none !important; }

.em-synced-youtube-poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-synced-youtube-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.48));
}

.em-synced-youtube-poster-icon,
.em-synced-youtube-poster-label { position: relative; z-index: 1; }

.em-synced-youtube-poster-icon {
    display: grid;
    width: clamp(62px, 12vw, 88px);
    height: clamp(62px, 12vw, 88px);
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: rgba(220, 0, 0, 0.94);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1;
    text-indent: 0.12em;
}

.em-synced-youtube-poster-label {
    position: absolute;
    right: 14px;
    bottom: 12px;
    left: 14px;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    text-align: center;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px #000;
    white-space: nowrap;
}

.em-synced-youtube-poster:focus-visible {
    outline: 3px solid #72aee6;
    outline-offset: -4px;
}

.em-synced-media-panel.is-audio .em-synced-media-stage {
    aspect-ratio: auto;
    min-height: 70px;
}

.em-synced-media-panel.is-audio .em-synced-media-player {
    padding: 8px;
}

.em-synced-media-panel.is-size-compact,
.em-synced-media-panel.is-size-minimized { width: min(100%, 420px); }

.em-synced-media-panel.is-size-minimized:not(.is-audio) {
    width: 240px;
    min-width: 240px;
}

.em-synced-media-panel.is-size-minimized:not(.is-audio) .em-synced-media-stage {
    min-width: 240px;
    min-height: 0;
    aspect-ratio: 16 / 9;
}

.em-synced-media-error {
    position: absolute;
    z-index: 7;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 10px;
    padding: 24px;
    color: #fff;
    background: rgba(15, 23, 42, 0.94);
    text-align: center;
}

.em-synced-media-error[hidden] { display: none !important; }
.em-synced-media-error p { max-width: 46ch; margin: 0; font-size: 13px; line-height: 1.45; }
.em-synced-media-error button {
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    color: #fff;
    background: #2563eb;
    cursor: pointer;
    font-weight: 750;
}

.em-app-media-pip-setting {
    align-items: center;
    gap: 12px;
}

.em-app-media-pip-setting[hidden] { display: none !important; }

.em-app-media-pip-setting > span:first-child { min-width: 0; }
.em-app-media-pip-setting strong,
.em-app-media-pip-setting small { display: block; }
.em-synced-pip-setting-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.em-synced-pip-setting-actions button {
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
}
.em-synced-pip-setting-actions button:disabled { opacity: 0.46; cursor: not-allowed; }

.em-app-shell-layer .em-app-controls .em-app-source-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    min-width: 150px;
    max-width: 220px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 750;
}

.em-app-source-action[hidden] { display: none !important; }
.em-app-source-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-app-source-icon { display: grid; flex: 0 0 auto; }
.em-app-source-icon svg { width: 18px; height: 18px; }
.em-app-media-source-setting[hidden],
.em-app-media-rate-setting[hidden],
.em-app-media-volume-setting[hidden] { display: none !important; }

.em-synced-source-overlay {
    z-index: 1190;
}

.em-synced-source-overlay[hidden] { display: none !important; }

.em-synced-source-dialog .em-synced-source-notice {
    margin: 0 20px;
    padding: 10px 12px;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    color: #334155;
    background: #eff6ff;
    font-size: 12px;
    line-height: 1.45;
}

.em-synced-source-grid.em-app-mode-grid {
    padding-top: 14px;
    padding-bottom: 20px;
}

.em-synced-source-card.em-app-mode-card {
    position: relative;
}

.em-synced-source-card > span:nth-child(2) {
    min-width: 0;
}

.em-synced-source-card strong,
.em-synced-source-card small { display: block; }
.em-synced-source-card strong { margin-bottom: 3px; }
.em-synced-source-card small { color: #64748b; }
.em-synced-source-card em {
    margin-left: auto;
    color: #047857;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.em-synced-source-card-icon.is-audio { color: #0369a1; background: #e0f2fe; }
.em-synced-source-card-icon.is-youtube { color: #b91c1c; background: #fee2e2; }
.em-synced-source-card-icon.is-vimeo { color: #0e7490; background: #cffafe; }
.em-synced-source-card[aria-current="true"] .em-synced-source-card-icon {
    color: #047857;
    background: #dcfce7;
}

@media (max-width: 600px) {
    .em-app-source-text { max-width: 110px; }
    .em-synced-count-in-card { min-width: 124px; padding: 11px 18px 10px; border-radius: 15px; }
    .em-synced-media-panel.is-pip-floating { max-width: calc(100vw - 24px); border-radius: 11px; }
    .em-synced-pip-setting-actions { width: 100%; justify-content: flex-start; }
    .em-synced-pip-drag-handle { top: 4px; width: 50px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .em-synced-count-in-card { animation: none; }
    .em-synced-media-panel { scroll-behavior: auto; }
}
