/* Search history confirmation shares the library dialog surface and actions. */
.mp-search-history-confirm {
    box-sizing: border-box;
    background: var(--mp-profile-surface, #fff);
    color: var(--mp-menu-text, #34434a);
    border-color: var(--mp-menu-header-divider, #dce3e6);
    font-family: 'Roboto', sans-serif;
}
.mp-search-history-confirm h2 { margin: 0 0 16px; font-size: 20px; font-weight: 600; line-height: 1.4; }
.mp-search-history-confirm p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--mp-menu-muted, #718087); }
.mp-search-history-confirm .btn { min-height: 40px; padding: 8px 16px; border: 1px solid var(--mp-menu-header-divider, #dce3e6); border-radius: 999px; background: var(--mp-profile-surface, #fff); color: var(--mp-menu-text, #34434a); font-size: 14px; font-weight: 500; }
.mp-search-history-confirm [data-history-cancel]:hover { background: var(--mp-menu-hover-bg, #f1f3f4); }
.mp-search-history-confirm .btn[data-history-cancel]:not(:disabled):active {
    background: var(--mp-menu-control-pressed-bg);
    border-color: transparent;
    color: var(--mp-btn-icon-text-active);
    box-shadow: none;
}
.mp-library-delete-actions :is(.btn-danger, [data-history-confirm]) {
    background: #c03a30;
    border-color: #c03a30;
    color: #fff;
}
.mp-library-delete-actions :is(.btn-danger, [data-history-confirm]):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible) {
    background: #b43128;
    border-color: #b43128;
    color: #fff;
}
.mp-library-delete-actions :is(.btn-danger, [data-history-confirm]):not(:disabled):not([aria-disabled="true"]):not(.is-disabled, .disabled):active {
    background: #a82b22;
    border-color: #a82b22;
    color: #fff;
    box-shadow: none;
}
.mp-search-history-confirm .btn:focus-visible { outline: 2px solid var(--mp-menu-focus-ring, #007f6e); outline-offset: 3px; }
.mp-search-history-confirm .mp-library-delete-actions { flex-wrap: wrap; }

/* Playlist deletion follows the other modal forms and their paired actions. */
#mp-playlists-delete-dialog-title {
    margin: 0 0 16px;
    color: var(--mp-menu-action-color);
    font-size: var(--mp-menu-title-size);
    font-weight: var(--mp-menu-title-weight);
    line-height: 1.4;
}
#mp-playlists-delete-dialog .mp-playlists-delete-target {
    margin-block-start: 0;
    border-color: var(--mp-menu-header-divider);
}
#mp-playlists-delete-dialog .mp-playlists-target-cover {
    padding-top: 0;
}
#mp-playlists-delete-dialog .mp-library-delete-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}
#mp-playlists-delete-dialog .mp-library-delete-actions > .btn {
    min-height: 44px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 400;
    white-space: normal;
}
body #mp-playlists-modal #mp-playlists-delete-cancel {
    background: transparent;
    border-color: var(--mp-menu-header-divider);
    color: var(--mp-menu-text);
}
body #mp-playlists-modal #mp-playlists-delete-cancel:not(:disabled):is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg);
}
body #mp-playlists-modal #mp-playlists-delete-cancel:not(:disabled):active {
    background: var(--mp-menu-control-pressed-bg);
    color: var(--mp-btn-icon-text-active);
    box-shadow: none;
}
#mp-playlists-modal #mp-playlists-delete-dialog .btn:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 3px;
}

/* Avatar editor follows the same neutral secondary-action contract. */
body .mp-profile-crop-modal .mp-profile-crop-action,
body .mp-profile-crop-modal .mp-profile-settings-btn--cancel {
    color: var(--mp-menu-text, #34434a);
    background: var(--mp-profile-surface, #fff);
    border: 1px solid var(--mp-menu-header-divider, #dce3e6);
    text-decoration: none;
}
body .mp-profile-crop-modal .mp-profile-crop-action:not(:disabled):is(:hover, :focus-visible),
body .mp-profile-crop-modal .mp-profile-settings-btn--cancel:is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg, #f1f3f4);
    color: var(--mp-menu-text, #34434a);
    text-decoration: none;
}
body .mp-profile-crop-modal .mp-profile-crop-action:disabled { color: var(--mp-menu-muted, #718087); }
body .mp-profile-crop-modal .mp-profile-crop-action svg { flex-shrink: 0; }
body .mp-profile-crop-modal .mp-profile-crop-viewport { border-radius: 12px; }
body .mp-profile-crop-modal .mp-profile-crop-mask { border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
body .mp-profile-crop-modal .mp-profile-crop-zoom-label { color: var(--mp-menu-text, #34434a); font-size: 14px; }
body .mp-profile-crop-modal .mp-profile-crop-zoom {
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.mp-profile-crop-zoom::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: var(--mp-menu-header-divider, #dce3e6); }
.mp-profile-crop-zoom::-moz-range-track { height: 4px; border-radius: 999px; background: var(--mp-menu-header-divider, #dce3e6); }
.mp-profile-crop-zoom::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 2px solid var(--mp-profile-surface, #fff); border-radius: 50%; background: #009682; box-shadow: 0 0 0 1px #009682; }
.mp-profile-crop-zoom::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid var(--mp-profile-surface, #fff); border-radius: 50%; background: #009682; box-shadow: 0 0 0 1px #009682; }
body .mp-profile-crop-modal .modal-footer { gap: 12px; flex-wrap: wrap; }

/* Reset favorites is neutral at rest and destructive on interaction. */
html body #headerAppsMenu .header-apps-actions-popup > .header-apps-restore-btn:not(:disabled):is(:hover, :focus-visible):not(:active) {
    color: var(--mp-menu-danger-color) !important;
    background: var(--mp-menu-danger-hover-bg) !important;
}

/* Shared color-mode control (profile menu / login) */
.mp-color-mode {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}
.mp-color-mode-label {
    color: var(--bs-secondary-color, #6b7280);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.mp-color-mode .mp-color-mode-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
}

.mp-color-mode .mp-color-mode-option {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 6px;
    width: 100% !important;
    height: 40px !important;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: var(--bs-secondary-color, #6c757d) !important;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mp-color-mode .mp-color-mode-option > svg { flex: 0 0 16px; width: 16px; height: 16px; }
.mp-color-mode .mp-color-mode-option:hover {
    background: #f1f3f4 !important;
    color: #20272b !important;
}

.mp-color-mode .mp-color-mode-option.is-active {
    background: #e4f3ee !important;
    color: #006858 !important;
    box-shadow: none;
}

.mp-color-mode .mp-color-mode-option:focus-visible {
    outline: 2px solid #009682;
    outline-offset: 1px;
}

html[data-bs-theme="dark"] .mp-color-mode .mp-color-mode-option:hover {
    background: #292f33 !important;
    color: #e5e7eb !important;
}
html[data-bs-theme="dark"] .mp-color-mode .mp-color-mode-option.is-active {
    color: #71dfca !important;
    background: #203e38 !important;
}

.mp-login-color-mode {
    display: flex;
    justify-content: center;
    padding: 0 24px 24px;
    color: var(--bs-body-color);
}

.mp-login-color-mode .mp-color-mode {
    justify-content: center;
    padding: 8px 0;
}

/*
 * Dark theme
 * ----------
 * Most dark colors are generated from the existing stylesheets:
 *   color-mode.base.generated.css / color-mode.app.generated.css
 *   (run `node bin/build-dark-mode.mjs` after changing any CSS).
 * This file only holds the palette and the few things that cannot be derived.
 *
 *   page      #14171a   darkest, app background
 *   surface   ~#1b1f23  cards, panels, menus (generated from white)
 *   raised    ~#22272c  hover rows, inputs, chips (generated from light greys)
 *   border    ~#2e343a
 *   text      #e3e6e9   muted text ~#9aa3ad
 *   accent    KIT teal, lightened for text on dark
 */
html[data-bs-theme="dark"] {
    color-scheme: dark;

    --bs-body-bg: #14171a;
    --bs-body-color: #e3e6e9;
    --bs-emphasis-color: #fff;
    --bs-secondary-color: #9aa3ad;
    --bs-secondary-bg: #1b1f23;
    --bs-tertiary-bg: #22272c;
    --bs-border-color: #2e343a;
    --bs-link-color: #4fd1bb;
    --bs-link-hover-color: #7fe0cf;

    /* Accent on hover, neutral foreground on press. */
    --mp-btn-icon-text-hover: #4fd1bb;
    --mp-btn-text-text-hover: #4fd1bb;
    --mp-control-pressed-text: #e3e6e9;
    --mp-btn-icon-text-active: var(--mp-control-pressed-text);
    --mp-btn-text-text-active: var(--mp-control-pressed-text);
    --mp-btn-toggle-text-active: var(--mp-control-pressed-text);
    --mp-btn-lang-text-active: var(--mp-control-pressed-text);

    /* Round header buttons (notifications, bookmarks, apps) */
    --mp-btn-icon-bg: #22272c;
    --mp-btn-icon-bg-hover: #2b3137;
    --mp-btn-icon-bg-active: #343b42;
    --mp-btn-icon-text: #c9d1d9;
}

/* Header and footer: one calm surface with a hairline, same in both templates. */
html[data-bs-theme="dark"] .page-header,
html[data-bs-theme="dark"] .page-header.scrolled {
    background: #1b1f23 !important;
    border-bottom: 1px solid var(--bs-border-color);
    box-shadow: none !important;
    color: var(--bs-body-color);
}

html[data-bs-theme="dark"] .page-header .content-wrap {
    background: transparent !important;
}

html[data-bs-theme="dark"] .page-header .logo svg :is(.cls-1, .logo-text, .logo-text *) {
    fill: #fff;
}

html[data-bs-theme="dark"] .page-header :is(.project-title-main, .project-title-brand, .project-title-name) {
    color: #f0f3f5 !important;
}

html[data-bs-theme="dark"] .page-header .project-title-subtitle {
    color: #9aa3ad !important;
}

html[data-bs-theme="dark"] .page-header .mp-header-brand-divider {
    background-color: #009682;
}

html[data-bs-theme="dark"] .page-header .mp-header-control {
    color: #c9d1d9;
}

html[data-bs-theme="dark"] .page-footer,
html[data-bs-theme="dark"] body:has(.mp-bib-header) .page-footer {
    background: #1b1f23 !important;
    border-top: 1px solid var(--bs-border-color) !important;
    color: #9aa3ad;
}

html[data-bs-theme="dark"] :is(.page-footer, .footer-meta-navigation) .content-wrap,
html[data-bs-theme="dark"] .footer-meta-navigation {
    background: transparent !important;
}

html[data-bs-theme="dark"] :is(.page-footer, .footer-meta-navigation) :is(p, li, span, .copyright, .infobox, h2, h3, h4) {
    color: #9aa3ad !important;
}

html[data-bs-theme="dark"] :is(.page-footer, .footer-meta-navigation) a {
    color: #c9d1d9 !important;
}

html[data-bs-theme="dark"] :is(.page-footer, .footer-meta-navigation) a:hover {
    color: #4fd1bb !important;
}

/* Guest menu in the ILIAS header shares the BIB dropdown surface in dark mode. */
html[data-bs-theme="dark"] .mp-header-menu .navigation-profile-menu ul {
    border-color: #383d42;
    background: #1a1d20;
}

html[data-bs-theme="dark"] .mp-header-menu .navigation-profile-menu ul li.navigation-breadcrumb {
    border-bottom-color: var(--mp-menu-header-divider, #353a3f);
    background: #1a1d20;
}

html[data-bs-theme="dark"] .mp-header-menu .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-title {
    color: #b2b9c0;
}

/* Profile menu: every row looks the same (text, icon, hover). */
html[data-bs-theme="dark"] .navigation-profile-menu ul li :is(a, button, .mp-profile-menu-label):not(.mp-color-mode-option):not(.navigation-profile-close) {
    color: #e3e6e9 !important;
    opacity: 1 !important;
}

html[data-bs-theme="dark"] .navigation-profile-menu ul li :is(a, button):not(.mp-color-mode-option):not(.navigation-profile-close):is(:hover, :focus-visible) {
    background-color: #292f33 !important;
}

/* One icon style: same size column, same light tint, regardless of how the icon is drawn. */
html[data-bs-theme="dark"] .navigation-profile-menu ul li .mp-profile-nav-icon,
html[data-bs-theme="dark"] .navigation-profile-menu ul li .mp-profile-settings-open::before,
html[data-bs-theme="dark"] .navigation-profile-menu ul li .mp-recent-open::before,
html[data-bs-theme="dark"] .navigation-profile-menu ul li .mp-playlists-open > .mp-profile-nav-icon {
    filter: brightness(0) invert(1) !important;
    opacity: 0.7 !important;
}

html[data-bs-theme="dark"] .navigation-profile-menu ul li i:not(.mp-playlists-open > i),
html[data-bs-theme="dark"] .navigation-profile-menu ul li svg:not(.mp-color-mode svg) {
    color: #aab3bc !important;
    opacity: 1;
}

/* Toolbar under the header (sort, page size, view, Über, Hilfe): one color, one hover. */
html[data-bs-theme="dark"] :is(.mp-about-btn, .mp-help-controls, .controls-row .btn-sort-icon, .controls-row .sort-label, .mp-details-nav-right .btn-sort-icon) {
    color: #c9d1d9 !important;
}

html[data-bs-theme="dark"] :is(.mp-about-btn, .mp-help-controls, .controls-row .btn-sort-icon, .controls-row .sort-label) :is(span, svg, i, .btn-sort-text) {
    color: inherit !important;
}

html[data-bs-theme="dark"] :is(.mp-about-btn, .mp-help-controls button, .controls-row .btn-sort-icon, .controls-row .sort-label):is(:hover, :focus-visible) {
    color: #4fd1bb !important;
}

/* About page: its own variables hold light tints that the generator cannot see. */
html[data-bs-theme="dark"] {
    --about-teal-light: #17332f;
    --about-teal-mid: #1f453f;
    --about-teal-dark: #4fd1bb;
    --about-slate-light: #22292f;
    --about-slate: #8fb0c4;
    --about-muted: #9aa3ad;
}

/* White call-to-action button on the teal band stays white, like in light mode. */
html[data-bs-theme="dark"] .about-btn-primary {
    background: #fff !important;
    border-color: #fff !important;
    color: #007d6a !important;
}

html[data-bs-theme="dark"] .about-btn-primary:hover {
    background: #e6f4f2 !important;
}

/* Compact legal navigation in the profile/guest menu, without wrapped labels. */
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 48px;
    margin: 0;
    padding: 2px 8px;
    background: #00876c;
    overflow: hidden;
}
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) > li.meta {
    display: block;
    flex: 0 1 44px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
/* Legacy mobile rules force every widget (including search) to display:flex !important. */
body .navigation-profile .navigation-profile-menu ul.side-widgets > li.search {
    display: none !important;
}
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) > li.meta {
    width: 44px !important;
    height: 44px !important;
}
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) > li.meta > a {
    pointer-events: auto !important;
    width: 100% !important;
    height: 44px !important;
}
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) > li.meta > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: 0 !important;
    line-height: 1;
    background: transparent;
    overflow: hidden;
}
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) a:hover { background: rgba(255,255,255,.14); }
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) a:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) .svg-icon { display: flex; width: 18px; height: 18px; margin: 0; }
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) .svg-icon svg { width: 18px; height: 18px; }
body .navigation-profile .navigation-profile-menu ul.side-widgets:not(.active) a:has(.svg-icon)::before { content: none; }
body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets > li.meta > a::before {
    content: '';
    display: block;
    position: static;
    transform: none;
    width: 18px;
    height: 18px;
    background: currentColor;
    mask: var(--mp-meta-icon) center / contain no-repeat;
}
body[data-template="bib"] .navigation-profile .side-widgets a[accesskey="1"] { --mp-meta-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7M5 9v12h5v-7h4v7h5V9'/%3E%3C/svg%3E"); }
body[data-template="bib"] .navigation-profile .side-widgets a[href*='language'],
body[data-template="bib"] .navigation-profile .side-widgets a[href*='leichte-sprache'] { --mp-meta-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M12 5C9 3 5 3 3 4v15c3-1 6-1 9 1 3-2 6-2 9-1V4c-2-1-6-1-9 1Zm0 0v15'/%3E%3C/svg%3E"); }
body[data-template="bib"] .navigation-profile .side-widgets a[accesskey="8"] { --mp-meta-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M14 3H5v18h14V8Zm0 0v5h5M8 12h8M8 16h8'/%3E%3C/svg%3E"); }
body[data-template="bib"] .navigation-profile .side-widgets a[href*='datenschutz'] { --mp-meta-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='m12 3 8 3v6c0 5-8 9-8 9s-8-4-8-9V6Z'/%3E%3C/svg%3E"); }
body[data-template="bib"] .navigation-profile .side-widgets a[href*='barriere'] { --mp-meta-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='4' r='2'/%3E%3Cpath d='M4 9h16M12 9v6m0 0-4 6m4-6 4 6'/%3E%3C/svg%3E"); }
body[data-template="bib"] .navigation-profile .side-widgets a[accesskey="3"] { --mp-meta-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M9 3h6v5H9ZM3 16h6v5H3Zm12 0h6v5h-6ZM12 8v4m-6 4v-4h12v4'/%3E%3C/svg%3E"); }

/* Preserve the expanded layout while its container smoothly collapses. */
body .navigation-profile .navigation-profile-menu ul.side-widgets.active.is-collapse-ready {
    box-sizing: border-box;
    max-height: var(--mp-footer-expanded-height) !important;
    overflow: hidden !important;
    transition: max-height 240ms cubic-bezier(.4, 0, .2, 1), padding 240ms cubic-bezier(.4, 0, .2, 1);
}
body[data-template] .navigation-profile .navigation-profile-menu ul.side-widgets.active.is-collapsing {
    max-height: var(--mp-sidewidgets-collapsed-height, 48px) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
    body .navigation-profile .navigation-profile-menu ul.side-widgets.active.is-collapse-ready {
        transition: none;
    }
}

/* Keep legal tiles on the green surface instead of inheriting pale menu states. */
body .navigation-profile .navigation-profile-menu ul.side-widgets > li.meta:is(:hover, :focus-within, :active) {
    background: transparent !important;
}
body .navigation-profile .navigation-profile-menu ul.side-widgets > li.meta > a {
    color: #fff !important;
    background: transparent !important;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
    body .navigation-profile .navigation-profile-menu ul.side-widgets > li.meta > a:hover {
        background: #007561 !important;
    }
}
body .navigation-profile .navigation-profile-menu ul.side-widgets > li.meta > a:focus-visible {
    background: #007561 !important;
    outline: 2px solid #fff !important;
    outline-offset: -4px;
}
body .navigation-profile .navigation-profile-menu ul.side-widgets > li.meta > a:active {
    background: #006451 !important;
}

/* Expanded legal navigation: three balanced icon tiles per row (six BIB links). */
@media (max-width: 1024px) {
    body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets.active {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 0;
        box-sizing: border-box;
        padding: 38px 20px 20px !important;
        background: #00876c;
    }
    body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets.active > li.meta:nth-child(n) {
        box-sizing: border-box;
        width: auto !important;
        min-width: 0;
        height: auto !important;
        margin: 0 !important;
        padding: 0;
        border: 0 !important;
    }
    body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets.active > li.meta::before {
        display: none !important;
    }
    body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets.active > li.meta:nth-child(-n+3) {
        border-bottom: 1px solid rgba(255, 255, 255, .5) !important;
    }
    body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets.active > li.meta:not(:nth-child(3n)):not(:last-child) {
        border-right: 1px solid rgba(255, 255, 255, .5) !important;
    }
    body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets.active > li.meta > a {
        position: relative !important;
        box-sizing: border-box;
        min-height: 124px;
        height: 100% !important;
        padding: 14px 8px !important;
        gap: 12px;
        color: #fff;
        overflow-wrap: anywhere;
        hyphens: auto;
        text-decoration: none;
        pointer-events: auto !important;
    }
    body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets.active > li.meta > a::before {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        margin: 0;
    }
    body[data-template="bib"] .navigation-profile .navigation-profile-menu ul.side-widgets.active > li.meta > a:focus-visible {
        outline: 2px solid #fff;
        outline-offset: -4px;
    }
}

body .to-top-button {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--mp-to-top-footer-offset, 0px));
}

body .to-top-button {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #dce3e6;
    border-radius: 50%;
    background: #fff;
    color: #34434a;
    box-shadow: 0 3px 12px rgba(15, 23, 28, 0.12);
    cursor: pointer;
}
body .to-top-button::before { content: none; }
body .to-top-button > svg { flex: 0 0 22px; }
body .to-top-button:hover { background: #f1f3f4; color: #007f6e; }
body .to-top-button:focus-visible { outline: 2px solid var(--mp-menu-focus-ring); outline-offset: 3px; }
body .to-top-button:active { background: #e9edef; box-shadow: none; }

html[data-bs-theme="dark"] .to-top-button {
    background: #22272c !important;
    border: 1px solid var(--bs-border-color) !important;
    color: #e3e6e9 !important;
}

html[data-bs-theme="dark"] .to-top-button:hover {
    background: #30383d !important;
    color: #71dfca !important;
}

html[data-bs-theme="dark"] .to-top-button:active {
    background: #394147 !important;
}

html[data-bs-theme="dark"] .navigation-profile-menu :is(.profile-meta-label, .profile-meta-mail, .navigation-profile-title) {
    color: #9aa3ad !important;
}

html[data-bs-theme="dark"] .navigation-profile-menu .profile-meta-name {
    color: #fff !important;
}

html[data-bs-theme="dark"],
html[data-bs-theme="dark"] body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/*
 * Content images (video thumbnails, about-page screenshots) are slightly dimmed
 * so bright frames do not glare on a dark page. Player, logos, SVGs and avatars
 * are never filtered; hovering a thumbnail restores the original brightness.
 */
html[data-bs-theme="dark"] :is(img[class*="thumb"], [class*="thumb"] > img, [class*="thumb"] picture img, .about-shot-img, .about-overview-img):not([src$=".svg"]) {
    filter: brightness(0.88) contrast(1.04);
    transition: filter 0.2s ease;
}

html[data-bs-theme="dark"] :is(a, button, article, li, .search-result-media):hover :is(img[class*="thumb"], [class*="thumb"] > img, .about-shot-img) {
    filter: none;
}

/* Result area uses the page color, not a card surface. */
html[data-bs-theme="dark"] #main-containter,
html[data-bs-theme="dark"] #search-results-media {
    background-color: #14171a;
}

/* Inputs: calm raised surface, teal focus ring. */
html[data-bs-theme="dark"] :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) {
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

html[data-bs-theme="dark"] ::placeholder {
    color: #8b949e;
    opacity: 1;
}

html[data-bs-theme="dark"] :is(input, textarea, select):focus {
    border-color: #009682;
}

/* Native <select> popups and date pickers follow the theme. */
html[data-bs-theme="dark"] option {
    background-color: #1b1f23;
    color: var(--bs-body-color);
}

/* Slim dark scrollbars (Firefox + WebKit). */
html[data-bs-theme="dark"] * {
    scrollbar-color: #3a4148 transparent;
}

/* Modal backdrop a bit deeper than the default. */
html[data-bs-theme="dark"] .modal-backdrop {
    --bs-backdrop-bg: #000;
    --bs-backdrop-opacity: 0.6;
}

/* Drill-in settings: retain one panel rather than stacking dropdowns. */
.navigation-profile .navigation-profile-menu .mp-profile-subview[hidden] { display: none !important; }
.navigation-profile .navigation-profile-menu .mp-profile-subview:not([hidden]) {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
}
.navigation-profile .navigation-profile-menu .mp-profile-subview > :is(a, button) {
    position: static;
    flex: 0 0 auto;
}
.navigation-profile .navigation-profile-menu .mp-profile-subview > a.mp-profile-language-option {
    display: flex;
    visibility: visible;
    opacity: 1;
}
.navigation-profile .navigation-profile-menu.has-subview ul:not(.side-widgets) > li:not(.is-subview-owner):not(.navigation-breadcrumb),
.navigation-profile .navigation-profile-menu.has-subview .side-widgets,
.navigation-profile .navigation-profile-menu.has-subview .is-subview-owner > [data-profile-subview] { display: none !important; }
.navigation-profile .navigation-profile-menu.has-subview ul > li.is-subview-owner { margin: 0; padding: 0; border: 0; }
.navigation-profile .navigation-profile-menu ul li.mp-profile-language-link > button,
.navigation-profile .navigation-profile-menu ul li.mp-profile-color-mode > button,
.navigation-profile .navigation-profile-menu .mp-profile-subview > :is(button, a) {
    display: flex; align-items: center; gap: 8px; box-sizing: border-box;
    width: 100%; min-height: 44px; margin: 0; padding: 10px 12px;
    border: 0; border-radius: 8px; background: transparent; color: inherit;
    font: inherit; font-size: 15px; font-weight: 400; text-align: left; text-decoration: none; cursor: pointer;
}
.navigation-profile .navigation-profile-menu .mp-profile-help-icon {
    display: block;
    flex: 0 0 var(--mp-profile-nav-icon-col, 14px);
    width: var(--mp-profile-nav-icon-col, 14px);
    height: var(--mp-profile-nav-icon-col, 14px);
}
.navigation-profile .navigation-profile-menu ul li.help-link-mobile .mp-profile-help-submenu > a {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--mp-profile-nav-icon-gap, 8px);
}
.navigation-profile .navigation-profile-menu .mp-profile-help-submenu > a > span {
    min-width: 0;
}
.navigation-profile .navigation-profile-menu .mp-profile-current-value {
    margin-left: auto;
    color: #626b75;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}
html[data-bs-theme="dark"] .navigation-profile .navigation-profile-menu .mp-profile-current-value {
    color: #aab3bc;
}
.navigation-profile .navigation-profile-menu .mp-profile-next {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0 0 0 auto;
    border: 0;
    transform: rotate(-90deg);
}
.navigation-profile .navigation-profile-menu .mp-profile-theme-icon {
    flex: 0 0 var(--mp-profile-nav-icon-col, 14px);
    width: var(--mp-profile-nav-icon-col, 14px);
    height: var(--mp-profile-nav-icon-col, 14px);
}
.navigation-profile .navigation-profile-menu .mp-profile-current-value + .mp-profile-next { margin-left: 4px; }
.navigation-profile .navigation-profile-menu .mp-profile-subview > .mp-profile-back {
    gap: 12px;
    min-height: 44px;
    margin-bottom: 6px;
    font-weight: 500;
}
.navigation-profile .navigation-profile-menu .mp-profile-back > .mp-profile-back-icon {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}
.navigation-profile .navigation-profile-menu .mp-profile-subview > :is(a, button):is(:hover, :focus-visible) { background: #f1f3f4; }
.navigation-profile .navigation-profile-menu .mp-profile-language-option[aria-current="true"]::after,
.navigation-profile .mp-profile-subview .mp-color-mode-option.is-active::after {
    content: '';
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-left: auto;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4L19 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.navigation-profile .mp-profile-subview .mp-color-mode-label { display: none; }
.navigation-profile .mp-profile-subview .mp-color-mode { padding: 0; }
.navigation-profile .mp-profile-subview .mp-color-mode-options { display: flex; flex-direction: column; }

/* Language and appearance share one row rhythm and clear the header divider. */
.navigation-profile .navigation-profile-menu.has-subview :is(#mp-profile-language-options, #mp-profile-theme-options) {
    padding-block: 6px 0;
}
.navigation-profile .navigation-profile-menu :is(#mp-profile-language-options, #mp-profile-theme-options) > .mp-profile-back {
    margin-block-end: 6px;
    font-weight: var(--mp-menu-title-weight) !important;
}
.navigation-profile .navigation-profile-menu #mp-profile-language-options > .mp-profile-language-option,
.navigation-profile .navigation-profile-menu #mp-profile-theme-options .mp-color-mode-option {
    min-height: var(--mp-menu-row-height);
    height: auto !important;
    padding: 10px 12px !important;
    gap: 10px;
}
.navigation-profile .navigation-profile-menu #mp-profile-theme-options .mp-color-mode-options { gap: 0; }
.navigation-profile .navigation-profile-menu #mp-profile-theme-options .mp-color-mode-option { justify-content: flex-start; }
.navigation-profile .navigation-profile-menu :is(#mp-profile-language-options, #mp-profile-theme-options) :is(a, button):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: -2px;
}
.navigation-profile .mp-profile-subview .mp-color-mode-option {
    background: transparent !important;
    color: #20272b !important;
    font-weight: 400;
    border-radius: 8px !important;
}
.navigation-profile .navigation-profile-menu .mp-profile-language-option[aria-current="true"],
.navigation-profile .mp-profile-subview .mp-color-mode-option.is-active {
    background: transparent !important;
    color: #006858 !important;
    font-weight: 600;
}
.navigation-profile .navigation-profile-menu .mp-profile-language-option:is(:hover, :focus-visible),
.navigation-profile .mp-profile-subview .mp-color-mode-option:is(:hover, :focus-visible) {
    background: #f1f3f4 !important;
}
html[data-bs-theme="dark"] .navigation-profile .mp-profile-subview .mp-color-mode-option { color: #e3e6e9 !important; }
html[data-bs-theme="dark"] .navigation-profile .navigation-profile-menu .mp-profile-language-option[aria-current="true"],
html[data-bs-theme="dark"] .navigation-profile .mp-profile-subview .mp-color-mode-option.is-active { background: transparent !important; color: #71dfca !important; }
html[data-bs-theme="dark"] .navigation-profile .navigation-profile-menu .mp-profile-language-option:is(:hover, :focus-visible),
html[data-bs-theme="dark"] .navigation-profile .mp-profile-subview .mp-color-mode-option:is(:hover, :focus-visible) { background: #292f33 !important; }
.navigation-profile .navigation-profile-menu ul li > :is(a, button):is(:hover, :focus-visible) { background: #f1f3f4; }
@media (min-width: 1025px) {
    .navigation-profile .navigation-profile-menu .navigation-profile-close { display: none !important; }
    .navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb { border: 0; padding: 0; }
}

.navigation-profile .navigation-profile-menu ul li.help-link-mobile .mp-profile-help-toggle[data-profile-subview]::after {
    content: '';
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0 0 0 auto;
    border: 0;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.25 6.5L8 10.25L11.75 6.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: rotate(-90deg);
}
.navigation-profile .navigation-profile-menu ul li.help-link-mobile .mp-profile-help-submenu.mp-profile-subview {
    margin: 0; padding: 0; border: 0;
}

/* Neutral profile/guest navigation; green is reserved for interaction and selection.
   Filter legacy background-image icons too: their SVG strokes are hard-coded green. */
html:not([data-bs-theme="dark"]) body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-breadcrumb) :is(a, button):not(.is-active):not([aria-current="true"]):not(:hover):not(:focus-visible) {
    color: #34434a !important;
}
html:not([data-bs-theme="dark"]) body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li .mp-profile-nav-icon,
html:not([data-bs-theme="dark"]) body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li :is(.mp-profile-settings-open, .mp-recent-open)::before {
    filter: brightness(0) saturate(100%) invert(24%) sepia(12%) saturate(797%) hue-rotate(154deg) brightness(94%) contrast(88%) !important;
    opacity: 1 !important;
}
html:not([data-bs-theme="dark"]) body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li :is(svg, i, .mp-profile-menu-label) {
    color: inherit !important;
}
html:not([data-bs-theme="dark"]) body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-breadcrumb) :is(a, button):is(.is-active, [aria-current="true"]) {
    color: #006858 !important;
}
html:not([data-bs-theme="dark"]) body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-breadcrumb) :is(a, button):is(:hover, :focus-visible):not(:active) {
    background: #f1f3f4 !important;
}
html:not([data-bs-theme="dark"]) body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) .mp-profile-current-value {
    color: #66717c !important;
}

/* Personal content links are navigation, not notification counters. */
.navigation-profile .navigation-profile-menu .mp-nav-my-notes-profile .mp-my-notes-count {
    display: none;
}

/* Profile and guest menus use the library's SVG close control. */
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f1f3f4 !important;
    color: #465159 !important;
    opacity: 1;
    cursor: pointer;
    transition: background-color .16s ease;
}
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close::before,
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close::after {
    content: none !important;
}
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close > svg {
    display: block;
    visibility: visible;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: inherit !important;
}
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close:is(:hover, :focus-visible) {
    background: #e5e9eb !important;
}
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close:focus-visible {
    outline: 2px solid #64748b;
    outline-offset: 2px;
}
html[data-bs-theme="dark"] .navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close {
    background: #212529 !important;
    color: #b7bdc4 !important;
}
html[data-bs-theme="dark"] .navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close:is(:hover, :focus-visible) {
    background: #272b2f !important;
}

html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-actions > summary { color: #b7bdc4; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-actions > summary:hover,
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-actions[open] > summary { background: #252a2c; color: #c2c7cd; }
html[data-bs-theme="dark"] .mp-notifications-actions-menu { background: #1a1d20; border-color: #353a3f; color: #e3e6e9; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-actions-menu > button:not(:disabled):is(:hover, :focus-visible) { background: #292f33; color: #71dfca; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-actions-menu > .mp-notifications-dismiss-all:not(:disabled):is(:hover, :focus-visible) { color: #ffb4ab; }

html[data-bs-theme="dark"] .mp-notifications-item-actions-popup { background: #1a1d20; color: #e3e6e9; border-color: #353a3f; }
html[data-bs-theme="dark"] .mp-notifications-item-actions-popup > button:not(:disabled):is(:hover, :focus-visible),
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-item-actions:is(:hover, [aria-expanded="true"]) { background: #292f33; color: #71dfca; }
html[data-bs-theme="dark"] .mp-notifications-item-actions-popup > button.is-danger:not(:disabled):is(:hover, :focus-visible) { color: #ffb4ab; }

/* Notification controls follow the same dark palette as the library. */
html[data-bs-theme="dark"] .mp-notifications-panel {
    background: #1a1d20;
    border-color: #353a3f;
    color: #e3e6e9;
}
html[data-bs-theme="dark"] .mp-notifications-panel :is(.mp-notifications-panel-header, .mp-notifications-footer, .mp-notifications-item) { border-color: #353a3f; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-close {
    background: #212529 !important;
    color: #b7bdc4 !important;
}
html[data-bs-theme="dark"] .mp-notifications-panel :is(.mp-notifications-close, .mp-notifications-dismiss):is(:hover, :focus-visible) {
    background: #272b2f !important;
    color: #e3e6e9 !important;
}
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-dismiss { color: #aab3bc !important; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-item--unread { background: #203e38; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-item:is(:hover, :focus-within) { background: #292f33; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-item-title { color: #e3e6e9; }
html[data-bs-theme="dark"] .mp-notifications-panel :is(.mp-notifications-item-message, .mp-notifications-empty, .mp-notifications-footer > button) { color: #aab3bc; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-item-icon { background: #203e38; color: #71dfca; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-footer > button:is(:hover, :focus-visible) { background: #292f33; color: #71dfca; }
html[data-bs-theme="dark"] .mp-notifications-panel .mp-notifications-footer > .mp-notifications-dismiss-all:is(:hover, :focus-visible) { color: #ffb4ab; }

/* Display preferences are neutral controls, not primary action buttons. */
html[data-bs-theme="dark"] #mp-display-button {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #c9d1d9 !important;
}
html[data-bs-theme="dark"] #mp-display-button:is(:hover, :focus-visible, [aria-expanded="true"]) {
    color: #71dfca !important;
}
html[data-bs-theme="dark"] #mp-display-panel {
    background: #1a1d20 !important;
    color: #d3d7db;
    border-color: #353a3f !important;
    box-shadow: none !important;
}
html[data-bs-theme="dark"] #mp-display-panel .mp-display-section { border-color: #353a3f; }
html[data-bs-theme="dark"] #mp-display-panel :is(.mp-display-option, .mp-display-columns button) {
    background: transparent !important;
    color: #d3d7db !important;
    box-shadow: none !important;
}
html[data-bs-theme="dark"] #mp-display-panel :is(.mp-display-option, .mp-display-columns button):not(:disabled):is(:hover, :focus-visible) {
    background: #292f33 !important;
    color: #71dfca !important;
}
html[data-bs-theme="dark"] #mp-display-panel .mp-display-option[aria-pressed="true"] {
    color: #71dfca !important;
}
html[data-bs-theme="dark"] #mp-display-panel .mp-display-columns button[aria-pressed="true"] {
    background: #203e38 !important;
    color: #71dfca !important;
}
html[data-bs-theme="dark"] #mp-display-panel .mp-display-columns button:disabled {
    background: transparent !important;
    color: #9aa3ad !important;
    opacity: .45;
}

/* One selection check for every menu: 16px box, 2-unit rounded SVG stroke. */
:root {
    --mp-menu-check-size: 16px;
    --mp-menu-check-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4L19 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.mp-portal-sort-menu .sort-dropdown-item.active::after,
.mp-details-series-header .mp-playback-controls .sort-dropdown-item.active::after,
.mp-playback-source-panel .mp-playback-source-check:not([hidden]),
#mp-display-panel .mp-display-option[aria-pressed="true"]::before,
.navigation-profile .navigation-profile-menu .mp-profile-language-option[aria-current="true"]::after,
.navigation-profile .mp-profile-subview .mp-color-mode-option.is-active::after {
    box-sizing: border-box;
    flex: 0 0 var(--mp-menu-check-size);
    width: var(--mp-menu-check-size);
    height: var(--mp-menu-check-size);
    margin-right: 0;
    border: 0;
    transform: none;
    background: currentColor;
    mask: var(--mp-menu-check-image) center / contain no-repeat;
}
.mp-playback-source-check[hidden] { display: none; }
/* Preserve the display menu's loading spinner instead of showing a check. */
#mp-display-panel .mp-display-option.is-loading[aria-pressed="true"]::before {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    background: none;
    mask: none;
}
.mp-playlist-menu-panel button > svg.mp-playlist-menu-check,
#mp-playlists-modal svg.mp-library-display-check,
#mp-playlists-modal svg.mp-library-sort-check {
    flex: 0 0 var(--mp-menu-check-size);
    width: var(--mp-menu-check-size);
    height: var(--mp-menu-check-size);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Shared typography for library and home toolbar pills (not menu entries). */
:root {
    --mp-toolbar-pill-font-size: 14px;
    --mp-toolbar-pill-font-weight: 500;
}
#mp-playlists-modal #mp-playlists-search .mp-playlists-global-sort > summary,
#mp-playlists-modal .mp-library-section-toolbar .mp-library-sort-trigger {
    font-size: var(--mp-toolbar-pill-font-size);
    font-weight: var(--mp-toolbar-pill-font-weight);
    line-height: 1;
}

/* Single typography contract for menu entries, including selected and mobile
   states. Keep titles, metadata and icon-only triggers outside this rule. */
:root {
    --mp-menu-entry-size: 14px;
    --mp-menu-entry-weight: 400;
    --mp-menu-entry-line-height: 1.4;
}
body :is(#sort-dropdown-menu, #details-sort-dropdown-menu, #mp-recent-sort-menu, #mp-bookmarks-sort-menu, #mp-my-notes-sort-menu, #badges-dropdown-menu, #mp-page-size-menu).mp-portal-sort-menu.sort-dropdown-menu .sort-dropdown-item,
.sort-dropdown-menu .sort-dropdown-item,
.mp-details-series-header .mp-playback-controls .sort-dropdown-item,
.mp-playback-source-panel .mp-playback-source-option,
body .mp-media-actions-panel > :is(button, a),
body .mp-notes-more-menu__item,
.mp-playlist-menu-panel :is(button, a),
#mp-playlists-modal .mp-playlist-menu-panel :is(button, a),
#mp-playlists-modal .mp-library-section-menu .mp-library-section-actions button,
#mp-playlists-modal .mp-library-section-menu .mp-library-display-choices button,
#mp-playlists-modal .mp-library-section-toolbar .sort-dropdown-item,
#mp-display-panel .mp-display-option,
#mp-display-panel .mp-display-columns button,
.navigation-profile .navigation-profile-menu ul li:not(.navigation-breadcrumb):not(.navigation-profile-user) > :is(a, button),
.navigation-profile .navigation-profile-menu .mp-profile-subview > :is(a, button),
.navigation-profile .navigation-profile-menu .mp-profile-subview .mp-color-mode-option,
.mp-notifications-panel .mp-notifications-actions-menu > button,
.mp-notifications-item-actions-popup > button,
body .navigation-search .search-form #search-text-suggest .mp-search-history-menu > button {
    font-family: "Roboto", sans-serif !important;
    font-size: var(--mp-menu-entry-size) !important;
    font-weight: var(--mp-menu-entry-weight) !important;
    line-height: var(--mp-menu-entry-line-height) !important;
}

/* Shared menu row geometry and neutral palette. Deliberately exclude numeric
   segmented controls, titles, metadata and icon-only disclosure buttons. */
:root {
    --mp-menu-text: #34434a;
    --mp-menu-muted: #718087;
    --mp-menu-hover-bg: #f1f3f4;
    --mp-menu-row-height: 40px;
}
html[data-bs-theme="dark"] {
    --mp-menu-text: #c2c7cd;
    --mp-menu-muted: #a4afb8;
    --mp-menu-hover-bg: #30383d;
}
body :is(
    .sort-dropdown-menu .sort-dropdown-item,
    .mp-media-actions-panel > button, .mp-media-actions-panel > a,
    .mp-notes-more-menu__item,
    .mp-playlist-menu-panel > button, .mp-playlist-menu-panel > a,
    .mp-library-section-actions > button,
    #mp-display-panel .mp-display-option,
    .mp-notifications-actions-menu > button,
    .mp-notifications-item-actions-popup > button,
    .mp-profile-subview > a, .mp-profile-subview > button
) {
    box-sizing: border-box;
    min-height: var(--mp-menu-row-height) !important;
    padding: 10px 12px !important;
    gap: 10px;
}
body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-breadcrumb):not(.navigation-profile-user) > :is(a, button) {
    min-height: var(--mp-menu-row-height);
    font-family: "Roboto", sans-serif !important;
}
body :is(.mp-notifications-actions-menu, .mp-notifications-item-actions-popup, .mp-library-section-actions, .mp-playlist-menu-panel) > :is(button, a):not(:hover):not(:focus-visible):not(:disabled):not([aria-disabled="true"]):not(.active):not(.is-active) {
    color: var(--mp-menu-text) !important;
}
body :is(.mp-notifications-actions-menu, .mp-notifications-item-actions-popup) > button > svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: inherit;
}
@media (pointer: coarse) {
    :root { --mp-menu-row-height: 44px; }
}

/* One icon scale for menu entries and text-labelled toolbar controls.
   Header controls, close buttons and filter-chip crosses are intentionally excluded. */
:root {
    --mp-menu-icon-size: 16px;
    --mp-menu-icon-stroke: 1.8;
}
body :is(
    .sort-dropdown-item,
    .mp-media-actions-panel > button, .mp-media-actions-panel > a,
    .mp-playlist-menu-panel > button, .mp-playlist-menu-panel > a,
    .mp-library-section-actions > button,
    .mp-notifications-actions-menu > button,
    .mp-notifications-item-actions-popup > button,
    #headerAppsMenu .header-apps-actions-popup > button,
    #mp-display-panel .mp-display-option,
    .mp-library-display-choices > button,
    .mp-search-history-menu > button,
    .mp-library-sort-trigger,
    .mp-playlists-global-sort > summary,
    #sortDropdownMenuButton, #mp-display-button
) > svg,
body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-breadcrumb) > :is(a, button) > svg,
body .navigation-profile .navigation-profile-menu .mp-profile-subview > :is(a, button) > svg {
    flex: 0 0 var(--mp-menu-icon-size) !important;
    width: var(--mp-menu-icon-size) !important;
    height: var(--mp-menu-icon-size) !important;
    vertical-align: middle;
}
body :is(
    .sort-dropdown-item, .mp-media-actions-panel, .mp-playlist-menu-panel, .mp-library-section-actions,
    .mp-notifications-actions-menu, .mp-notifications-item-actions-popup,
    .header-apps-actions-popup, .mp-display-option, .mp-library-display-choices,
    .mp-search-history-menu, .mp-library-sort-trigger, .mp-playlists-global-sort,
    #sortDropdownMenuButton, #mp-display-button, .mp-profile-subview
) svg[viewBox="0 0 24 24"][fill="none"] {
    stroke-width: var(--mp-menu-icon-stroke);
}
body .navigation-profile .navigation-profile-menu {
    --mp-profile-nav-icon-col: 16px;
}
body .navigation-profile .navigation-profile-menu :is(.mp-profile-nav-icon, .mp-profile-help-icon, .mp-profile-theme-icon) {
    flex: 0 0 var(--mp-menu-icon-size) !important;
    width: var(--mp-menu-icon-size) !important;
    height: var(--mp-menu-icon-size) !important;
}

/* Keep both directions of submenu navigation in the profile icon color. */
body .navigation-profile .navigation-profile-menu {
    --mp-profile-chevron-color: #34434a;
}
html[data-bs-theme="dark"] body .navigation-profile .navigation-profile-menu {
    --mp-profile-chevron-color: #aab3bc;
}
body .navigation-profile .navigation-profile-menu ul li :is(.mp-profile-next, .mp-profile-back-icon),
body .navigation-profile .navigation-profile-menu ul li.help-link-mobile .mp-profile-help-toggle[data-profile-subview]::after {
    color: var(--mp-profile-chevron-color) !important;
}

/* Shared guest/profile and notification header tokens. */
:root {
    --mp-menu-title-size: 16px;
    --mp-menu-title-weight: 500;
    --mp-menu-header-divider: #e3e8eb;
}
html[data-bs-theme="dark"] { --mp-menu-header-divider: #353a3f; }
@media (max-width: 1024px) {
    :root { --mp-menu-title-size: 20px; }
}

/* Shared guest/profile header, independent of legacy breadcrumb styles. */
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: auto;
    min-height: 64px;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mp-menu-header-divider);
}
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb + li.mp-profile-login {
    margin-block-start: 6px;
}
.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    color: #20272b;
    font-size: var(--mp-menu-title-size);
    font-weight: var(--mp-menu-title-weight);
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
}

.navigation-profile .navigation-profile-menu ul li.navigation-breadcrumb .navigation-profile-close {
    position: static;
    flex: 0 0 40px;
    margin: 0;
}

/* Desktop: scroll the outer panel so the track sits at the panel's edge,
   not inside the padded list. */
@media (min-width: 1025px) {
    body .navigation-profile > .navigation-profile-menu {
        /* Reserve room for the measured header, dropdown gap and bottom margin. */
        max-height: calc(100vh - var(--mp-header-offset, 64px) - 1rem);
        max-height: calc(100dvh - var(--mp-header-offset, 64px) - 1rem);
        overflow: hidden auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--mp-scrollbar-thumb, #b8c0c6) transparent;
    }
}

/* The mobile profile drawer owns the viewport. Only its menu list scrolls
   in the collapsed-footer layout; the legal links never overlap the list. */
@media (max-width: 1024px) {
    html:has(.navigation-profile.active > .navigation-profile-menu),
    body:has(.navigation-profile.active > .navigation-profile-menu) {
        overflow: hidden;
    }
    body .navigation-profile > .navigation-profile-menu {
        --mp-sidewidgets-collapsed-height: calc(48px + env(safe-area-inset-bottom));
        position: fixed;
        inset: 0;
        z-index: 1050;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: none;
        height: 100dvh;
        padding: env(safe-area-inset-top) 0 0;
        border: 0;
        border-radius: 0;
        overflow: hidden;
    }
    body .navigation-profile.active > .navigation-profile-menu {
        display: flex;
    }
    body .navigation-profile > .navigation-profile-menu > ul:not(.side-widgets) {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        max-width: none;
        max-height: none;
        box-sizing: border-box;
        margin: 0;
        padding: 0 8px 8px;
        border: 0;
        overflow: hidden auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--mp-scrollbar-thumb, #b8c0c6) transparent;
    }
    body .navigation-profile > .navigation-profile-menu > ul > li.navigation-breadcrumb {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--mp-mobile-profile-surface, #fff);
    }
    html[data-bs-theme="dark"] .navigation-profile-menu {
        --mp-mobile-profile-surface: #1a1d20;
    }
    body .navigation-profile > .navigation-profile-menu > ul:not(.side-widgets) > li::before,
    body .navigation-profile > .navigation-profile-menu > ul:not(.side-widgets) > li:last-of-type::after {
        content: none;
    }
    body .navigation-profile.active > .navigation-profile-menu > ul.side-widgets {
        position: relative !important;
        flex: 0 0 auto;
        border-radius: 0;
    }
    body .navigation-profile.active > .navigation-profile-menu > ul.side-widgets:not(.active) {
        min-height: var(--mp-sidewidgets-collapsed-height);
        padding-bottom: env(safe-area-inset-bottom) !important;
        gap: clamp(0px, 1vw, 4px);
    }
    body .navigation-profile.active > .navigation-profile-menu > ul.side-widgets.active {
        max-height: min(80dvh, calc(100dvh - 80px - env(safe-area-inset-top)));
    }
}

/* App launcher shares header, surface and close-control styling with menus. */
#headerAppsMenu {
    padding: 0;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 12px;
    background: #fff;
    color: #20272b;
    box-shadow: none;
}
#headerAppsMenu .header-apps-menu-head {
    min-height: 64px;
    box-sizing: border-box;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mp-menu-header-divider);
}
#headerAppsMenu .header-apps-menu-title {
    margin: 0;
    padding: 0;
    min-width: 0;
    font-size: var(--mp-menu-title-size) !important;
    font-weight: var(--mp-menu-title-weight) !important;
    line-height: 1.4 !important;
    color: inherit;
}
#headerAppsMenu .header-apps-menu-close {
    position: static;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex: 0 0 40px;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f1f3f4 !important;
    color: #465159 !important;
    box-shadow: none;
}
#headerAppsMenu .header-apps-menu-close::before,
#headerAppsMenu .header-apps-menu-close::after { content: none !important; }
#headerAppsMenu .header-apps-menu-close > svg {
    display: block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    visibility: visible;
}
#headerAppsMenu .header-apps-menu-close:is(:hover, :focus-visible) {
    background: #e5e9eb !important;
}
#headerAppsMenu :is(.header-apps-edit-btn, .header-apps-restore-btn):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: -2px !important;
}
#headerAppsMenu .header-apps-section { padding: 12px 16px; }
#headerAppsMenu .header-apps-section-label {
    font-size: 12px;
    font-weight: 500;
    color: #626b75;
}
#headerAppsMenu .header-apps-footer {
    margin: 0;
    padding: 6px 8px;
    border-top: 1px solid var(--mp-menu-header-divider);
}
#headerAppsMenu :is(.header-apps-edit-btn, .header-apps-restore-btn) {
    font-size: var(--mp-menu-entry-size);
    font-weight: var(--mp-menu-entry-weight);
    min-height: 40px;
    color: inherit;
}
#headerAppsMenu :is(.header-apps-edit-btn, .header-apps-restore-btn):is(:hover, :focus-visible) {
    background: #f1f3f4;
    color: #006858;
}
html[data-bs-theme="dark"] #headerAppsMenu { background: #1a1d20; color: #e3e6e9; }
html[data-bs-theme="dark"] #headerAppsMenu .header-apps-menu-close {
    background: #212529 !important;
    color: #b7bdc4 !important;
}
html[data-bs-theme="dark"] #headerAppsMenu .header-apps-menu-close:is(:hover, :focus-visible) { background: #272b2f !important; }
html[data-bs-theme="dark"] #headerAppsMenu .header-apps-section-label { color: #aab3bc; }
html[data-bs-theme="dark"] #headerAppsMenu :is(.header-apps-edit-btn, .header-apps-restore-btn):is(:hover, :focus-visible) {
    background: #292f33;
    color: #71dfca;
}

/* Compact app header actions, matching notification controls. */
#headerAppsMenu .header-apps-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
#headerAppsMenu .header-apps-menu-close {
    flex: 0 0 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    transform: none !important;
}
#headerAppsMenu .header-apps-actions { position: relative; display: block; width: 40px; height: 40px; padding: 0; margin: 0; border: 0; }
#headerAppsMenu .header-apps-actions > summary {
    display: flex; align-items: center; justify-content: center;
    box-sizing: border-box; width: 40px; height: 40px; min-height: 40px;
    margin: 0; padding: 0; border: 0 !important; border-radius: 50%;
    background: transparent; color: #68757b; list-style: none; cursor: pointer;
    outline: none; box-shadow: none;
}
#headerAppsMenu .header-apps-actions > summary::before,
#headerAppsMenu .header-apps-actions > summary::after,
#headerAppsMenu .header-apps-actions > summary::-webkit-details-marker { display: none; content: none; }
#headerAppsMenu .header-apps-actions > summary::marker { content: ''; }
#headerAppsMenu .header-apps-actions > summary:hover,
#headerAppsMenu .header-apps-actions[open] > summary { background: var(--mp-menu-control-open-bg); }
#headerAppsMenu .header-apps-actions-popup {
    position: absolute; z-index: 2; right: 0; top: calc(100% + 6px);
    width: 240px; max-width: calc(100vw - 32px); box-sizing: border-box;
    padding: 6px; border: 1px solid var(--mp-menu-header-divider); border-radius: 12px;
    background: #fff; color: #20272b;
}
#headerAppsMenu .header-apps-actions-popup > button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    margin: 0; padding: 10px 12px; text-align: left; border-radius: 8px;
}
#headerAppsMenu .header-apps-actions-popup > button[hidden] { display: none; }
#headerAppsMenu .header-apps-actions-popup > button > svg { flex: 0 0 18px; }
html[data-bs-theme="dark"] #headerAppsMenu .header-apps-actions > summary { color: #b7bdc4; }
html[data-bs-theme="dark"] #headerAppsMenu .header-apps-actions-popup { background: #1a1d20; color: #e3e6e9; }

/* One bookmark silhouette across header, menus, cards and detail actions. */
body .mp-bookmark-icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }
body .mp-bookmark-btn.is-bookmarked > .mp-bookmark-icon { fill: currentColor; }
body .mp-bookmarks-open--icon-only > .mp-bookmark-icon {
    width: var(--mp-header-control-icon, 24px);
    height: var(--mp-header-control-icon, 24px);
}
body .mp-notifications-bookmark-icon > svg { display: block; }

:root {
    --mp-details-selected-hover-bg: #007f6e;
    --mp-toolbar-pill-hover-bg: #f5f7f8;
    --mp-toolbar-pill-hover-border: #c5cfd3;
    --mp-toolbar-pill-hover-text: #34434a;
}
html[data-bs-theme="dark"] {
    --mp-toolbar-pill-hover-bg: #252a2c;
    --mp-toolbar-pill-hover-border: #59636a;
    --mp-toolbar-pill-hover-text: #c2c7cd;
}

/* Library sorting pills highlight the whole control, not the caret. */
#mp-playlists-modal :is(.mp-library-section-toolbar .mp-library-sort-trigger, .mp-playlists-global-sort > summary):not(:disabled):is(:hover, :focus-visible):not(:active, [aria-expanded="true"]) {
    background: var(--mp-toolbar-pill-hover-bg) !important;
    border-color: var(--mp-toolbar-pill-hover-border) !important;
    color: var(--mp-toolbar-pill-hover-text) !important;
}
#mp-playlists-modal :is(.mp-library-section-toolbar .mp-library-sort-trigger, .mp-playlists-global-sort > summary) > :is(svg, .btn-sort-text, .mp-playlists-sort-label) {
    color: inherit !important;
}

/* Shared back links on About, FAQ and Details. Current-page labels are not interactive. */
:root {
    --mp-metadata-link-accent: #005d50;
}
html[data-bs-theme="dark"] {
    --mp-metadata-link-accent: #a2ecdb;
}
:root body .mp-toolbar-left > a.mp-breadcrumb-current.mp-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 12px;
    box-sizing: border-box;
    border-radius: 999px;
    color: var(--mp-menu-focus-ring);
    font: 500 14px/1.4 "Roboto", sans-serif;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}
:root body .mp-toolbar-left > a.mp-breadcrumb-current.mp-breadcrumb-link:is(:hover, :focus-visible) {
    background-color: var(--mp-toolbar-pill-hover-bg);
    box-shadow: inset 0 0 0 1px var(--mp-toolbar-pill-hover-border);
    text-decoration: none;
}
:root body .mp-toolbar-left > a.mp-breadcrumb-current.mp-breadcrumb-link:active {
    background-color: var(--mp-btn-icon-bg-active);
    box-shadow: none;
}
:root body .mp-toolbar-left > a.mp-breadcrumb-current.mp-breadcrumb-link:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
}
:root body .mp-toolbar-left > a.mp-breadcrumb-current.mp-breadcrumb-link i {
    color: inherit;
    transform: none;
}

:root {
    --mp-details-action-height: 36px;
    --mp-details-meta-inset: 8px;
}

:root body a.mp-info-new-series-link:any-link {
    box-sizing: border-box;
    min-height: var(--mp-details-action-height);
    padding: 4px var(--mp-details-meta-inset);
    gap: 10px;
    margin: 0;
    border: 0;
    color: var(--mp-series-link-pressed-text, var(--mp-menu-action-color));
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}
:root body a.mp-info-new-series-link:any-link:active {
    --mp-series-link-pressed-text: var(--mp-btn-icon-text-active);
}
:root body a.mp-info-new-series-link:any-link > .mp-details-toolbar-series-name {
    color: inherit;
}
:root body a.mp-info-new-series-link > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--mp-series-link-pressed-text, var(--mp-menu-muted));
}
:root body :is(a.mp-info-new-series-link, .mp-playback-title-picker > a.mp-playback-title-line, .mp-playback-title-picker.mp-media-actions > button.mp-playback-title-line) {
    border-radius: 999px;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}
:root body :is(a.mp-info-new-series-link, .mp-playback-title-picker > a.mp-playback-title-line, .mp-playback-title-picker.mp-media-actions > button.mp-playback-title-line):is(:hover, :focus-visible) {
    background-color: var(--mp-toolbar-pill-hover-bg);
    box-shadow: inset 0 0 0 1px var(--mp-toolbar-pill-hover-border);
    text-decoration: none;
}
:root body :is(a.mp-info-new-series-link, .mp-playback-title-picker > a.mp-playback-title-line, .mp-playback-title-picker.mp-media-actions > button.mp-playback-title-line):active {
    background-color: var(--mp-btn-icon-bg-active);
    color: var(--mp-btn-icon-text-active);
    box-shadow: none;
}
html body :is(a.mp-info-new-series-link, .mp-playback-title-picker > a.mp-playback-title-line, .mp-playback-title-picker.mp-media-actions > button.mp-playback-title-line):active > :is(svg, .mp-playback-heading) {
    color: inherit;
}
:root body :is(a.mp-info-new-series-link, .mp-playback-title-picker > a.mp-playback-title-line, .mp-playback-title-picker.mp-media-actions > button.mp-playback-title-line):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: -2px;
}

/* Match series and author links without reusing the card's turquoise tint. */
html body #main-containter #search-results-media a:is(.search-result-media .search-media-series-link, .search-result-media .search-media-meta .meta-series-link, .search-result-media .search-media-authors a, .mp-series-rail__authors a):any-link {
    border-radius: 5px;
}
html body #main-containter #search-results-media :is(.search-result-media .search-media-authors, .mp-series-rail__authors) a:any-link {
    padding-inline: 3px;
    margin-inline: -3px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
html body #main-containter #search-results-media a:is(.search-result-media .search-media-series-link, .search-result-media .search-media-meta .meta-series-link, .search-result-media .search-media-authors a, .mp-series-rail__authors a):any-link:is(:hover, :focus-visible) {
    background-color: transparent;
    color: var(--mp-metadata-link-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
/* Series labels are flex items, so underline the text span itself. */
#main-containter #search-results-media .search-result-media a:is(.search-media-series-link, .meta-series-link):is(:hover, :focus-visible) > :is(.search-media-series-name, .meta-series-link-text) {
    text-decoration: underline;
    text-underline-offset: 2px;
}
html body #main-containter #search-results-media a:is(.search-result-media .search-media-series-link, .search-result-media .search-media-meta .meta-series-link, .search-result-media .search-media-authors a, .mp-series-rail__authors a):any-link:active {
    background-color: var(--mp-btn-icon-bg-active);
    color: var(--mp-control-pressed-text);
}
/* In list view the author icon sits outside the links. Press the entire
   icon-and-name group as one surface, just like the adjacent series link. */
#main-containter #search-results-media.list-view .search-media-authors-line {
    padding: 3px 8px;
    border-radius: 5px;
}
html body #main-containter #search-results-media.list-view .search-media-authors-line:has(a:any-link:active) {
    background-color: var(--mp-btn-icon-bg-active);
}
html body #main-containter #search-results-media.list-view .search-media-authors-line:has(a:any-link:active) > i {
    color: var(--mp-control-pressed-text);
}
html body #main-containter #search-results-media.list-view .search-result-media .search-media-authors-line a:any-link:active {
    background-color: transparent;
}
#main-containter #search-results-media :is(.search-result-media a.search-media-series-link, .search-result-media a.meta-series-link, .search-result-media .search-media-authors a, .mp-series-rail__authors a):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
}

/* A transcript hit is one link; wrapped text stays in its own column. */
.search-media-captions {
    --mp-caption-time-bg: #007d6c;
    --mp-caption-time-text: #fff;
    display: grid;
    gap: 8px;
}
.search-media-captions > .search-media-caption-hit:any-link {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
}
.search-media-caption-hit__time {
    background-color: var(--mp-caption-time-bg);
    color: var(--mp-caption-time-text);
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    white-space: nowrap;
}
.search-media-caption-hit__text {
    overflow-wrap: anywhere;
}
.search-media-caption-hit:is(:hover, :focus-visible) > .search-media-caption-hit__text {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.search-media-caption-hit:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
}
html[data-bs-theme="dark"] .search-media-captions em {
    background-color: #f0d678;
    color: #28240e;
}

/* Detail save actions share the rounded toolbar controls. */
body .mp-details-bookmark-action .mp-details-toolbar-btn:is(.mp-bookmark-btn, .mp-playlist-add) {
    box-sizing: border-box;
    min-height: var(--mp-details-action-height);
    padding: 8px 14px;
    gap: 8px;
    border: 1px solid #dce3e6;
    border-radius: 999px;
    background: #fff;
    color: #34434a;
    box-shadow: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
body .mp-details-bookmark-action .mp-details-toolbar-btn:is(.mp-bookmark-btn, .mp-playlist-add):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
    box-shadow: none;
}
html[data-bs-theme="dark"] body .mp-details-bookmark-action .mp-details-toolbar-btn:is(.mp-bookmark-btn, .mp-playlist-add):not(.is-bookmarked) { background: #1a1d20; border-color: #3f454a; color: #c2c7cd; }
body .mp-details-bookmark-action .mp-details-toolbar-btn:is(.mp-bookmark-btn, .mp-playlist-add):not(.is-bookmarked):is(:hover, :focus-visible),
html[data-bs-theme="dark"] body .mp-details-bookmark-action .mp-details-toolbar-btn:is(.mp-bookmark-btn, .mp-playlist-add):not(.is-bookmarked):is(:hover, :focus-visible) {
    background: var(--mp-toolbar-pill-hover-bg);
    border-color: var(--mp-toolbar-pill-hover-border);
    color: var(--mp-toolbar-pill-hover-text);
}
body .mp-details-bookmark-action .mp-details-toolbar-btn:is(.mp-bookmark-btn, .mp-playlist-add):not(:disabled):not(.is-bookmarked):active,
html[data-bs-theme="dark"] body .mp-details-bookmark-action .mp-details-toolbar-btn:is(.mp-bookmark-btn, .mp-playlist-add):not(:disabled):not(.is-bookmarked):active {
    background: var(--mp-btn-icon-bg-active);
    border-color: transparent;
    color: var(--mp-btn-icon-text-active);
}
body .mp-details-bookmark-action .mp-details-toolbar-btn.mp-bookmark-btn.is-bookmarked {
    --mp-details-saved-bg: var(--mp-btn-primary-bg);
    background: var(--mp-details-saved-bg);
    border-color: var(--mp-details-saved-bg);
    color: var(--mp-btn-primary-text);
}
body .mp-details-bookmark-action .mp-details-toolbar-btn.mp-bookmark-btn.is-bookmarked:hover {
    --mp-details-saved-bg: var(--mp-details-selected-hover-bg);
}
body .mp-details-bookmark-action .mp-details-toolbar-btn.mp-bookmark-btn.is-bookmarked:is(:hover, :focus-visible) {
    color: var(--mp-btn-primary-text);
}
body .mp-details-bookmark-action .mp-details-toolbar-btn.mp-bookmark-btn.is-bookmarked:not(:disabled):active {
    --mp-details-saved-bg: var(--mp-btn-primary-bg-active);
}

:root {
    --mp-search-dark-idle-bg: #1f2426;
    --mp-search-dark-idle-border: #383e40;
}

/* One search surface for playlist, transcript and notes, including relocated panes. */
body .mp-sidebar-search-field {
    --mp-sidebar-search-bg: #f5f7f8;
    --mp-sidebar-search-border: #dce3e6;
    --mp-sidebar-search-text: #20272b;
    --mp-sidebar-search-muted: #68757b;
    --mp-sidebar-search-hover: #e9edef;
    --mp-sidebar-search-pressed: #dce3e6;
    position: relative;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
}
html[data-bs-theme="dark"] body .mp-sidebar-search-field,
body .vjs-kit-fs-sidepanel__pane .mp-sidebar-search-field {
    --mp-sidebar-search-bg: var(--mp-search-dark-idle-bg);
    --mp-sidebar-search-border: var(--mp-search-dark-idle-border);
    --mp-sidebar-search-text: #e2e8f0;
    --mp-sidebar-search-muted: #a0a9b2;
    --mp-sidebar-search-hover: #292f33;
    --mp-sidebar-search-pressed: #383e40;
}
html body .mp-sidebar-search-field:is(:hover, :focus-within) { background: transparent; box-shadow: none; }
html body .mp-sidebar-search-field input:is(input, .form-control) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 2px 44px 0 40px !important;
    border: 1px solid var(--mp-sidebar-search-border);
    border-radius: 999px;
    background: var(--mp-sidebar-search-bg);
    color: var(--mp-sidebar-search-text);
    font: inherit;
    font-size: 1rem;
    line-height: normal;
    outline: none;
    box-shadow: none;
}
html body .mp-sidebar-search-field input:is(input, .form-control)::placeholder { color: var(--mp-sidebar-search-muted); opacity: 1; }
html body .mp-sidebar-search-field > button {
    position: absolute;
    top: 50%;
    right: 5px;
    left: auto;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mp-sidebar-search-muted);
    cursor: pointer;
    box-shadow: none;
}
html body .mp-sidebar-search-field > .mp-sidebar-search-focus { left: 5px; right: auto; }
html body .mp-sidebar-search-field > button > svg { display: block; flex: 0 0 18px; width: 18px; height: 18px; pointer-events: none; }
html body .mp-sidebar-search-field > button:not(:disabled):hover { background: var(--mp-sidebar-search-hover); color: var(--mp-sidebar-search-text); }
html body .mp-sidebar-search-field > button:not(:disabled):active { background: var(--mp-sidebar-search-pressed); color: var(--mp-sidebar-search-text); }
html body .mp-sidebar-search-field > button:focus-visible { outline: 2px solid #64748b; outline-offset: 1px; box-shadow: none; }
html body .mp-sidebar-search-field:has(input:placeholder-shown) > .mp-transcript-search-clear,
html body .mp-sidebar-search-field > button[hidden] { display: none !important; }
html body .mp-sidebar-search-field:has(input:disabled) > button { opacity: .45; pointer-events: none; }
@media (max-width: 575.98px) {
    html body .mp-sidebar-search-field input:is(input, .form-control) { height: 44px; padding-top: 4px !important; }
    html body .mp-sidebar-search-field > button { width: 34px; height: 34px; }
}

/* Transcript follows the library row and pill geometry. */
body .mp-details-transcript .mp-transcript-row--active .mp-transcript-line::before {
    background: rgba(0, 150, 130, .09);
}
body .mp-details-transcript .mp-transcript-row--active:hover .mp-transcript-line::before {
    background: rgba(0, 150, 130, .11);
}
body .mp-details-transcript .mp-transcript-line {
    display: grid;
    grid-template-columns: minmax(3.25rem, max-content) minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px;
    padding: 8px 6px;
    border-radius: 8px;
}
body .mp-details-transcript .mp-transcript-time { width: auto; grid-column: 1; grid-row: 1; }
body .mp-details-transcript .mp-transcript-bubble { min-width: 0; grid-column: 2; grid-row: 1; }
body .mp-details-transcript .mp-transcript-row-actions { grid-column: 3; grid-row: 1; display: flex; align-items: center; }
/* Opening the top-layer menu must not change the grid row's intrinsic size. */
body .mp-transcript-row-actions .mp-media-actions {
    box-sizing: border-box;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    min-height: 0;
    margin: 0;
    padding: 0;
}
body .mp-transcript-row-actions .mp-media-actions-panel[popover] { position: fixed; }
body .mp-transcript-row-actions .mp-media-actions > summary { width: 30px; height: 30px; }
body .mp-transcript-row-actions > .mp-transcript-note-btn {
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    opacity: 1;
}
body .mp-transcript-row-actions > .mp-transcript-note-btn:is(:hover, :focus-visible, :active) {
    background: #dce3e7;
    color: var(--mp-menu-text, #34434a);
    border-color: transparent;
}
html[data-bs-theme="dark"] body .mp-transcript-row-actions > .mp-transcript-note-btn:is(:hover, :focus-visible, :active),
body .vjs-kit-fs-sidepanel__pane[data-pane="transcript"] .mp-transcript-row-actions > .mp-transcript-note-btn:is(:hover, :focus-visible, :active) {
    background: #2a2f34;
    color: #d3d7db;
}
body .mp-transcript-row-actions > .mp-transcript-note-btn:not(:disabled):not([aria-disabled="true"]):active {
    background: var(--mp-btn-icon-bg-active);
    color: var(--mp-btn-icon-text-active);
}
body .mp-transcript-row-actions .mp-transcript-note-btn-icon {
    display: grid;
    place-items: center;
    line-height: 1;
}
body .mp-transcript-row-actions .mp-transcript-note-btn-icon::before {
    display: block;
    line-height: 1;
}
@media (hover: hover) {
    body .mp-transcript-row:not(:hover):not(:focus-within) .mp-transcript-row-actions > .mp-transcript-note-btn { opacity: 0; }
}
body .mp-transcript-row-actions .mp-media-actions-panel > button { opacity: 1; }
body .mp-transcript-row-actions .mp-media-actions-panel > button > svg {
    flex: 0 0 16px;
    color: inherit;
}
body .mp-details-transcript .mp-transcript-row:not(.mp-transcript-row--active):is(:hover, :focus-within) .mp-transcript-line { background: var(--mp-menu-hover-bg, #f1f3f4); }
body .mp-details-transcript .mp-transcript-lang-btn { border-radius: 999px; }
body .mp-details-transcript .mp-transcript-sync-btn {
    border-radius: 999px;
}

/* Size sidebar cards from the viewport, not from the number of rows. */
.mp-details-side-tab-content {
    --mp-details-list-panel-height: 70vh;
}
@media (min-width: 1025px) {
    .mp-details-side-tab-content {
        --mp-details-list-panel-height: clamp(70vh, calc(100dvh - 160px), 90dvh);
    }
}
.mp-details-side-tab-content--mobile-dock {
    --mp-details-list-panel-height: min(52vh, 420px);
}
.mp-details-side-tab-content > :is(#mp-details-playlist, #mp-details-transcript, #mp-details-notes) > :is(.mp-details-playlist, .mp-details-transcript, .mp-details-notes) {
    height: var(--mp-details-list-panel-height);
    max-height: none;
}
.mp-details-side-tab-content #mp-details-playlist > .mp-details-playlist {
    display: flex;
    flex-direction: column;
}
.mp-details-side-tab-content #mp-details-playlist :is(.mp-playback-head, .mp-playback-search, .mp-user-playlist-bar, #search-results-footer) {
    flex-shrink: 0;
}
.mp-details-side-tab-content #mp-details-playlist :is(.mp-user-playlist, .mp-details-series-list, .mp-user-playlist-list) {
    flex: 1 1 auto;
    min-height: 0;
}
.mp-details-side-tab-content #mp-details-playlist :is(.mp-details-series-list, .mp-user-playlist-list) {
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* In the page sidebar, show every item on the current playlist page in the document flow. */
.mp-details-side-tab-content:not(.mp-details-side-tab-content--mobile-dock) > #mp-details-playlist > .mp-details-playlist {
    height: auto;
    min-height: var(--mp-details-list-panel-height);
}
.mp-details-side-tab-content:not(.mp-details-side-tab-content--mobile-dock) #mp-details-playlist :is(.mp-details-series-list, .mp-user-playlist-list) {
    overflow: visible;
    scrollbar-gutter: auto;
}

body .mp-details-playlist .mp-playback-search { margin-bottom: 8px; }
body .mp-details-playlist .mp-playback-head {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mp-menu-header-divider);
}
body .vjs-kit-fs-sidepanel__pane .mp-details-playlist .mp-playback-head {
    border-bottom-color: rgba(255, 255, 255, .12);
}
body .mp-details-playlist .mp-playback-head > :first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    min-width: 0;
}
body .mp-details-playlist .mp-playback-head .mp-playback-title-picker {
    flex: 0 1 auto;
    width: max-content;
    height: auto;
    max-width: 100%;
}
body .mp-details-playlist .mp-playback-head .mp-playback-title-line {
    position: static;
    padding-block: 4px;
}
body .mp-details-playlist .mp-playback-head .mp-playback-heading {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mp-playback-source-panel .mp-playback-switch-status:not([hidden]) {
    padding: 8px 12px;
    line-height: 1.4;
    color: var(--mp-menu-muted);
}
body .mp-details-playlist .mp-playback-head .mp-playback-meta {
    box-sizing: border-box;
    flex-basis: 100%;
    max-width: 100%;
    /* Match the title inset: 8px padding + 20px icon + 10px gap. */
    padding-inline: 38px 8px;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}
@container (min-width: 560px) {
    body .mp-details-playlist .mp-playback-head > .mp-playback-controls {
        align-self: flex-start;
        min-height: 44px;
    }
}

/* Keep search, controls and list start aligned across the two tabs. */
body .mp-sidebar-list-header:is(.mp-notes-head, .mp-transcript-search) {
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--mp-menu-header-divider);
}
body .vjs-kit-fs-sidepanel__pane .mp-sidebar-list-header:is(.mp-notes-head, .mp-transcript-search) {
    border-bottom-color: rgba(255, 255, 255, .12);
}
.mp-sidebar-list-header > .mp-sidebar-search-field,
.mp-notes-search-row {
    min-height: 44px;
}
.mp-sidebar-list-header .mp-transcript-search-meta-row {
    gap: 6px 10px;
    min-height: 36px;
}
body .mp-sidebar-list-header .mp-transcript-search-meta-wrap > :is(.mp-transcript-search-meta-count, .mp-transcript-search-meta-label) {
    color: var(--mp-menu-text);
    color: color-mix(in srgb, var(--mp-menu-muted) 75%, var(--mp-menu-text));
    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
}
.mp-notes-search-row,
.mp-notes-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mp-notes-search-row > .mp-sidebar-search-field {
    flex: 1 1 auto;
    min-width: 0;
}
.mp-notes-search-row > .mp-notes-more-wrap {
    flex: 0 0 auto;
    margin-inline-start: 0;
}
body .mp-notes-head .mp-notes-controls-row {
    margin-top: 8px;
    flex-wrap: wrap;
}
.mp-notes-controls-row > .mp-transcript-search-meta-row {
    flex: 1 1 min-content;
    margin-top: 0;
}
.mp-sidebar-list-header .mp-transcript-search-meta-lang {
    font-family: "Roboto", sans-serif;
    gap: 4px 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
}
body .mp-sidebar-list-header .mp-transcript-search-meta-lang > .mp-transcript-lang-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}
.mp-sidebar-list-header .mp-transcript-lang-buttons {
    gap: 4px;
}
body .mp-sidebar-list-header .mp-transcript-lang-btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding-inline: 8px;
}
body .mp-sidebar-list-header + :is(.mp-details-transcript-scroll, .mp-details-notes-scroll),
body .mp-details-notes .mp-details-notes-scroll {
    margin-top: 6px;
    padding-top: 0;
}

/* Match the detail-page language controls, with neutral pills on the dark player surface. */
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-list-header .mp-transcript-lang-label {
    color: var(--mp-sidebar-search-muted, #a0a9b2);
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-list-header .mp-transcript-lang-btn {
    background: #202427;
    border-color: #3f454a;
    border-radius: 999px;
    color: #e2e8f0;
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-list-header .mp-transcript-lang-btn:not(:disabled):is(:hover, :focus-visible) {
    background: #25292d;
    border-color: #59636a;
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-list-header .mp-transcript-lang-btn:not(:disabled):active {
    background: #30383d;
    border-color: #7a848c;
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] :is(.mp-sidebar-list-header .mp-transcript-lang-btn.active, .mp-transcript-sync-btn) {
    background: var(--mp-btn-primary-bg);
    border-color: transparent;
    color: var(--mp-btn-primary-text);
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] :is(.mp-sidebar-list-header .mp-transcript-lang-btn.active, .mp-transcript-sync-btn):not(:disabled):is(:hover, :focus-visible) {
    background: var(--mp-btn-primary-bg-hover);
    border-color: transparent;
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] :is(.mp-sidebar-list-header .mp-transcript-lang-btn.active, .mp-transcript-sync-btn):not(:disabled):active {
    background: var(--mp-btn-primary-bg-active);
    border-color: transparent;
}

/* Keep the right-panel glyph legible over both bright video and black bars. */
#video-container .video-js .vjs-kit-fs-sidepanel-btn .vjs-kit-fs-sidepanel-icon {
    background-image: none !important;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M14.5 5v14'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Match the control bar's white hover/press layers over a dark backing.
   Unlike the control bar, these buttons can sit directly on a bright frame. */
#video-container .video-js :is(.vjs-kit-fs-notes-btn, .vjs-kit-fs-screenshot-btn, .vjs-kit-fs-sidepanel-btn) {
    --mp-player-overlay-highlight: transparent;
    background: linear-gradient(var(--mp-player-overlay-highlight), var(--mp-player-overlay-highlight)) rgba(18, 21, 24, .82) !important;
    color: #fff !important;
    filter: none;
}
#video-container .video-js .vjs-kit-fs-sidepanel-btn.is-open {
    --mp-player-overlay-highlight: rgba(255, 255, 255, .08);
}
#video-container .video-js :is(.vjs-kit-fs-notes-btn, .vjs-kit-fs-screenshot-btn, .vjs-kit-fs-sidepanel-btn):is(:hover, :focus-visible) {
    --mp-player-overlay-highlight: rgba(255, 255, 255, .16);
}
#video-container .video-js :is(.vjs-kit-fs-notes-btn, .vjs-kit-fs-screenshot-btn, .vjs-kit-fs-sidepanel-btn):active {
    --mp-player-overlay-highlight: rgba(255, 255, 255, .26);
    transform: none;
}
#video-container .video-js :is(.vjs-kit-fs-notes-btn, .vjs-kit-fs-screenshot-btn, .vjs-kit-fs-sidepanel-btn):focus-visible {
    outline: 2px solid rgba(255, 255, 255, .85) !important;
    outline-offset: -2px;
}

/* Keep the in-player headers compact without changing the detail-page cards. */
body .vjs-kit-fs-sidepanel__pane {
    --mp-player-search-height: 36px;
    --mp-player-search-row-height: 40px;
}
/* Override the legacy per-tab player rules: only the input draws the pill. */
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-search-field {
    min-height: var(--mp-player-search-row-height);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-search-field input {
    height: var(--mp-player-search-height);
    min-height: 0;
    padding-block: 0 !important;
    background: var(--mp-sidebar-search-bg);
    border-color: var(--mp-sidebar-search-border);
    color: var(--mp-sidebar-search-text);
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-search-field input::placeholder {
    color: var(--mp-sidebar-search-muted);
    opacity: 1;
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-search-field > button:not(:hover):not(:active) {
    color: var(--mp-sidebar-search-muted);
}
html body .video-js .vjs-kit-fs-sidepanel__pane[data-pane] .mp-sidebar-search-field > :is(.mp-transcript-search-clear, [data-playback-search-clear]) {
    right: 5px;
}
body .vjs-kit-fs-sidepanel__pane .mp-notes-search-row {
    min-height: var(--mp-player-search-row-height);
}
/* Keep one create button as the notes content moves into the player. */
.mp-notes-header-grid {
    position: relative;
}
body .mp-notes-header-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}
.mp-notes-header-grid .mp-notes-search-row {
    display: contents;
}
.mp-notes-header-grid .mp-sidebar-search-field {
    grid-area: 1 / 1 / 2 / 3;
    min-width: 0;
}
.mp-notes-header-grid .mp-notes-more-wrap {
    grid-area: 1 / 3;
}
.mp-notes-header-grid .mp-notes-create-wrap {
    grid-area: 2 / 1;
}
body .mp-notes-head .mp-notes-header-grid .mp-notes-controls-row {
    grid-area: 2 / 2 / 3 / 4;
    min-width: 0;
    margin-top: 0;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="notes"] .mp-notes-header-grid {
    display: block;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="notes"] .mp-notes-search-row {
    display: flex;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="notes"] .mp-notes-create-wrap {
    order: 0;
    flex: 0 0 auto;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="notes"] .mp-details-notes .mp-notes-create-pill {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="notes"] .mp-notes-create-pill > span {
    display: none;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="notes"] .mp-notes-create-wrap {
    position: static;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="notes"] .mp-notes-onboarding {
    inset: 48px 0 auto auto;
    max-width: 100%;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="notes"] .mp-notes-head .mp-notes-header-grid .mp-notes-controls-row {
    margin-top: 8px;
}
body .vjs-kit-fs-sidepanel__pane .mp-details-notes .mp-notes-toolbar-btn--more {
    width: var(--mp-player-search-row-height);
    height: var(--mp-player-search-row-height);
}
@media (pointer: coarse) {
    body .vjs-kit-fs-sidepanel__pane {
        --mp-player-search-height: 40px;
        --mp-player-search-row-height: 44px;
    }
}
/* Keep playlist actions beside the source when both fit inside the player pane. */
@container (min-width: 360px) {
    body .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-details-playlist .mp-playback-head {
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px;
    }
    body .vjs-kit-fs-sidepanel__pane .mp-playback-head > :first-child {
        flex: 1 1 0%;
        width: auto;
    }
    body .vjs-kit-fs-sidepanel__pane .mp-playback-head > .mp-playback-controls {
        width: auto;
    }
    body .vjs-kit-fs-sidepanel__pane .mp-playback-head :is(.mp-series-nav-arrows, .mp-user-playlist-nav[data-nav="next"]) {
        margin-inline-end: 0;
    }
}

/* Notes share the transcript's rounded controls and quiet row treatment. */
body #mp-details-notes-tab .mp-notes-tab-count { color: inherit; }
body .mp-details-notes .mp-transcript-lang-btn,
body .mp-details-notes .mp-notes-toolbar-btn { border-radius: 999px; }
/* Match the playlist toolbar's borderless overflow trigger. */
body .mp-details-notes .mp-notes-toolbar-btn--more {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mp-menu-text);
    box-shadow: none;
    transition: background-color 160ms ease, color 160ms ease;
}
body .mp-details-notes .mp-notes-toolbar-btn--more:is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg);
    color: var(--mp-menu-text);
    box-shadow: none;
}
body .mp-details-notes .mp-notes-row {
    margin-inline: 0;
    padding: 10px 8px;
    border-radius: 8px;
}
body .mp-details-notes .mp-notes-row:not(.mp-notes-row--focused):is(:hover, :focus-within) {
    background: var(--mp-menu-hover-bg, #f1f3f4);
}
body .mp-details-notes .mp-notes-row--focused { box-shadow: none; }
body .mp-details-notes .mp-notes-create-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 12px;
    font-size: 14px;
    white-space: nowrap;
}
body .mp-details-notes .mp-notes-create-pill:not(:disabled):is(:hover, :focus-visible) {
    background: var(--mp-btn-primary-bg-hover);
    border-color: var(--mp-btn-primary-bg-hover);
    color: var(--mp-btn-primary-text);
}
body .mp-details-notes .mp-notes-create-pill:not(:disabled):active {
    background: var(--mp-btn-primary-bg-active);
    border-color: var(--mp-btn-primary-bg-active);
    color: var(--mp-btn-primary-text);
}
body .mp-details-notes .mp-notes-create-pill:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
}
body .mp-details-notes .mp-notes-snippet {
    border: 0;
    border-radius: 8px;
    background: var(--mp-menu-hover-bg, #f1f3f4);
    color: var(--mp-menu-text, #34434a);
}
body .mp-details-notes .mp-notes-snippet-text { color: inherit; }
/* The video panel and library use the same note hierarchy and inline transcript quote. */
.mp-note-label {
    margin: 0 0 2px;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.4;
}
body :is(.mp-details-notes, #mp-playlists-modal #mp-my-notes-modal) .mp-note-copy,
.mp-note-image-caption .mp-note-copy {
    margin: 0;
    color: var(--mp-menu-text);
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.mp-note-context {
    margin: 0;
    padding-inline-start: 10px;
    border-inline-start: 2px solid var(--mp-menu-muted);
    color: var(--mp-menu-text);
    color: color-mix(in srgb, var(--mp-menu-muted) 25%, var(--mp-menu-text));
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.mp-note-content + .mp-note-context { margin-block-start: 10px; }
.mp-note-context > blockquote { margin: 0; }
body #mp-playlists-modal #mp-my-notes-modal .mp-note-content > img,
body .mp-details-notes .mp-note-image-preview > img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 16rem);
    max-height: 10rem;
    margin-block: 0;
    border-radius: 6px;
}
body #mp-playlists-modal #mp-my-notes-modal .mp-note-copy + img,
body .mp-details-notes .mp-note-copy + .mp-note-image-preview { margin-block-start: 8px; }
body .mp-details-notes .mp-note-image-preview {
    display: block;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: zoom-in;
}
body .mp-details-notes .mp-note-image-preview:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
}
.mp-note-image-dialog {
    width: fit-content;
    max-width: calc(100vw - 32px);
    overflow: auto;
}
.mp-note-image-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}
.mp-note-image-header h2 {
    flex: 1;
    margin: 0;
}
.mp-note-image-header > form > button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
}
.mp-note-image-caption {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    overflow-wrap: anywhere;
}
.mp-note-image-caption .mp-note-context { margin: 0; }
.mp-note-image-time {
    color: var(--mp-menu-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.mp-note-image-dialog > img {
    display: block;
    max-width: 100%;
    max-height: max(80px, calc(100dvh - 132px));
    width: auto;
    height: auto;
    object-fit: contain;
    margin-inline: auto;
}
body #mp-playlists-modal #mp-my-notes-modal .mp-my-notes-overview-note { padding: 12px; border-radius: 8px; }
body #mp-playlists-modal #mp-my-notes-modal .mp-my-notes-overview-note-meta { margin-bottom: 6px; }
body .mp-details-notes .mp-notes-line {
    display: grid;
    grid-template-columns: minmax(3.25rem, max-content) minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px;
}
body .mp-details-notes .mp-notes-time { justify-self: start; }
body .mp-details-notes .mp-note-actions,
body .mp-details-notes .mp-note-actions > summary { width: 30px; height: 30px; }
body .mp-details-notes .mp-note-actions .mp-notes-action-btn { text-decoration: none; }
body .mp-details-notes .mp-note-actions .mp-notes-action-btn:not(.mp-playlist-menu-danger) { color: var(--mp-menu-text); }
body .mp-details-notes .mp-note-actions .mp-notes-action-btn > svg { flex: 0 0 16px; }
html body .mp-details-notes .mp-note-actions .mp-playlist-menu-danger:not(:disabled):is(:hover, :focus-visible, :active) {
    color: var(--mp-menu-danger-color) !important;
    background: var(--mp-menu-danger-hover-bg) !important;
}
.mp-notes-info-dialog {
    font-size: 16px;
}
html[data-bs-theme="dark"] :is(.mp-notes-info-dialog, .mp-note-image-dialog) {
    background: #1a1d20;
}
.mp-notes-info-dialog h3 {
    margin: 16px 0 4px;
    font-size: inherit;
    font-weight: 600;
    color: inherit;
}
body .mp-details-notes .mp-notes-time { font-variant-numeric: tabular-nums; }
body .mp-details-notes .mp-notes-more-menu {
    box-sizing: border-box;
    width: max-content;
    min-width: min(240px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    border-radius: 12px;
    padding: 6px;
}
body .mp-details-notes .mp-notes-more-menu__item {
    border-radius: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
}
body .mp-details-notes .mp-notes-more-menu__item > svg {
    flex: 0 0 var(--mp-menu-icon-size);
    width: var(--mp-menu-icon-size);
    height: var(--mp-menu-icon-size);
}
body .mp-details-notes .mp-notes-more-menu__item > span {
    color: inherit;
}

/* Keep action labels beside their icons; only submenu chevrons align right. */
body #mp-details-page-size-menu [data-playback-actions-root] > .sort-dropdown-item {
    justify-content: flex-start;
    gap: 10px;
}
body #mp-details-page-size-menu [data-playback-actions-root] > .sort-dropdown-item > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}
body #mp-details-page-size-menu [data-playback-actions-root] .mp-playback-page-size-caret { margin-inline-start: auto; }

/* The tile menu uses a negative top offset; in list rows that clips the
   button against the details column. Keep it in its own title-row column. */
#main-containter #search-results-media.list-view .search-media-title-row:has(> .mp-media-actions) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    padding-inline-end: 0;
}
#main-containter #search-results-media.list-view .search-media-title-row > .mp-media-actions {
    position: relative;
    inset: auto;
    align-self: start;
}
#main-containter #search-results-media.list-view .search-media-title-row > .mp-media-actions > summary:focus-visible {
    outline-offset: -2px !important;
}

/* Detail overflow action matches the adjacent rounded save controls. */
body .mp-details-more-actions > summary {
    box-sizing: border-box;
    border: 1px solid var(--mp-menu-header-divider, #dce3e6);
    background: var(--mp-profile-surface, #fff);
    color: var(--mp-menu-text, #34434a);
}
body .mp-details-more-actions > summary:is(:hover, :focus-visible),
body .mp-details-more-actions[open] > summary {
    background: var(--mp-toolbar-pill-hover-bg);
    border-color: var(--mp-toolbar-pill-hover-border);
    color: var(--mp-toolbar-pill-hover-text);
}
body .mp-details-more-actions > summary:active {
    border-color: transparent;
}
body .mp-details-bookmark-action > .mp-details-more-actions-disabled:disabled {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 50%;
    background: transparent;
    color: var(--mp-menu-muted);
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
}
body .mp-details-more-actions .mp-media-actions-panel > button:disabled {
    opacity: .45;
    cursor: not-allowed;
}
body .mp-details-more-actions .mp-media-actions-panel > button > svg { flex-shrink: 0; }

/* Shared surfaces for the download and export dialogs. */
:is(#mp-export-modal, #mp-tech-modal) {
    --mp-details-dialog-surface: #fff;
    --mp-details-dialog-subtle: #f8f9fa;
}
html[data-bs-theme="dark"] :is(#mp-export-modal, #mp-tech-modal) {
    --mp-details-dialog-surface: #1a1d20;
    --mp-details-dialog-subtle: #212529;
}
#mp-export-modal .mp-export-modal-dialog {
    max-width: 640px;
}
:root :is(#mp-export-modal, #mp-tech-modal) .modal-content {
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 16px;
    background: var(--mp-details-dialog-surface);
    color: var(--mp-menu-text);
}
:root :is(#mp-export-modal, #mp-tech-modal) .modal-header,
#mp-export-modal .modal-footer {
    align-items: center;
    padding: 12px 16px;
    border-color: var(--mp-menu-header-divider);
}
:root :is(#mp-export-modal, #mp-tech-modal) .modal-title {
    margin: 0;
    color: var(--mp-menu-action-color);
    font-size: var(--mp-menu-title-size);
    font-weight: var(--mp-menu-title-weight);
    line-height: 1.4;
}
:is(#mp-export-modal, #mp-tech-modal) .mp-details-dialog-close {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin-inline-start: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--mp-details-dialog-subtle);
    color: var(--mp-menu-text);
    cursor: pointer;
}
:is(#mp-export-modal, #mp-tech-modal) .mp-details-dialog-close:is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg);
}
:is(#mp-export-modal, #mp-tech-modal) .mp-details-dialog-close:active {
    background: var(--mp-menu-control-pressed-bg);
}
:is(#mp-export-modal, #mp-tech-modal) .mp-details-dialog-close:focus:not(:focus-visible) {
    outline: none;
}
:is(#mp-export-modal, #mp-tech-modal) .mp-details-dialog-close:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: -2px;
}
#mp-export-modal .mp-export-new {
    padding: 16px;
}
#mp-export-modal .mp-export-field + .mp-export-field {
    margin-top: 16px;
}
#mp-export-modal .mp-export-field > label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}
#mp-export-modal .mp-export-field > .form-control {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 12px;
    background: var(--mp-details-dialog-subtle);
    color: var(--mp-menu-text);
    font-size: 14px;
    box-shadow: none;
}
#mp-export-modal .mp-export-field > .form-control:is(:hover, :focus) {
    border-color: var(--mp-toolbar-pill-hover-border);
}
#mp-export-modal .mp-export-code {
    min-height: 0;
    resize: vertical;
    font-family: var(--bs-font-monospace);
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: anywhere;
}
#mp-export-modal .mp-export-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
#mp-export-modal .mp-export-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    margin: 0;
    padding: 7px 14px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 999px;
    background: var(--mp-details-dialog-surface);
    color: var(--mp-menu-text);
    font-size: var(--mp-toolbar-pill-font-size);
    font-weight: var(--mp-toolbar-pill-font-weight);
    line-height: 20px;
    box-shadow: none;
}
#mp-export-modal .mp-export-pill:is(:hover, :active) {
    border-color: var(--mp-toolbar-pill-hover-border);
    background: var(--mp-toolbar-pill-hover-bg);
}
#mp-export-modal .mp-export-pill[aria-pressed="true"] {
    border-color: var(--mp-menu-focus-ring);
    background: var(--mp-details-dialog-subtle);
    font-weight: 600;
}
#mp-export-modal .mp-export-pill[aria-pressed="true"]:hover {
    background: var(--mp-toolbar-pill-hover-bg);
}
#mp-export-modal .mp-export-copy-btn,
#mp-tech-modal .mp-tech-download-action {
    min-height: 40px;
    padding: 8px 16px;
    gap: 8px;
    border: 1px solid var(--mp-btn-primary-bg);
    border-radius: 999px;
    background: var(--mp-btn-primary-bg);
    color: var(--mp-btn-primary-text);
    font-size: var(--mp-toolbar-pill-font-size);
    font-weight: var(--mp-toolbar-pill-font-weight);
    line-height: 20px;
}
#mp-export-modal .mp-export-copy-btn:hover,
#mp-tech-modal .mp-tech-download-action:hover {
    border-color: var(--mp-btn-primary-bg-hover);
    background: var(--mp-btn-primary-bg-hover);
    color: var(--mp-btn-primary-text);
}
#mp-export-modal .mp-export-pill:not(.mp-export-copy-btn):active {
    background: var(--mp-menu-control-pressed-bg);
}
#mp-export-modal .mp-export-copy-btn:active,
#mp-tech-modal .mp-tech-download-action:active {
    border-color: var(--mp-btn-primary-bg-active);
    background: var(--mp-btn-primary-bg-active);
    color: var(--mp-btn-primary-text);
}
#mp-export-modal :is(.mp-export-pill, .form-control):focus:not(:focus-visible) {
    outline: none;
}
#mp-export-modal :is(.mp-export-pill, .form-control):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
}

#mp-tech-modal .modal-body.mp-tech-new {
    padding: 16px;
}
#mp-tech-modal .mp-tech-download-list {
    gap: 12px;
}
#mp-tech-modal .mp-tech-download-item {
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 12px;
    background: var(--mp-details-dialog-subtle);
}
#mp-tech-modal .mp-tech-download-item-main {
    padding: 12px 14px;
}
#mp-tech-modal :is(.mp-tech-download-type, .mp-tech-download-meta-label) {
    color: var(--mp-menu-text);
}
#mp-tech-modal :is(.mp-tech-download-summary, .mp-tech-download-meta-value) {
    color: var(--mp-menu-text);
    color: color-mix(in srgb, var(--mp-menu-text) 65%, var(--mp-menu-muted));
}
#mp-tech-modal .mp-tech-download-details {
    border-top: 1px solid var(--mp-menu-header-divider);
}
#mp-tech-modal .mp-tech-download-details > .mp-tech-download-details-summary {
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    color: var(--mp-menu-text);
    font-size: 14px;
    text-decoration: none;
}
#mp-tech-modal .mp-tech-download-details > .mp-tech-download-details-summary:is(:hover, :focus-visible, :active),
#mp-tech-modal .mp-tech-download-details[open] > .mp-tech-download-details-summary {
    background: var(--mp-menu-hover-bg);
    color: var(--mp-menu-text);
}
#mp-tech-modal .mp-tech-download-meta {
    padding: 8px 14px;
}
#mp-tech-modal .mp-tech-download-meta-row {
    border-color: var(--mp-menu-header-divider);
}
#mp-tech-modal .mp-tech-download-action:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
}
#mp-tech-modal .mp-tech-download-details > .mp-tech-download-details-summary:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: -2px;
}

/* Detached detail sidebar navigation follows the home toolbar pill geometry. */
body #mp-details-side-tab.mp-details-side-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none;
}
body #mp-details-side-tab.mp-details-side-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
    min-height: 36px;
    margin: 0;
    padding: 7px 14px;
    border: 1px solid #dce3e6;
    border-radius: 999px;
    background: #fff;
    color: #34434a;
    font-family: inherit;
    font-size: var(--mp-toolbar-pill-font-size, 14px);
    font-weight: var(--mp-toolbar-pill-font-weight, 500);
    line-height: 20px;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: none;
    transition: background-color 160ms ease, border-color 160ms ease;
}
body #mp-details-side-tab.mp-details-side-tabs .nav-link.active {
    background: var(--mp-btn-primary-bg);
    border-color: var(--mp-btn-primary-bg);
    color: var(--mp-btn-primary-text);
}
body #mp-details-side-tab.mp-details-side-tabs .nav-link.active:hover {
    background: var(--mp-details-selected-hover-bg);
    border-color: var(--mp-details-selected-hover-bg);
}
/* The base stylesheet adds a dashed outline even after a pointer click. */
body #mp-details-side-tab.mp-details-side-tabs .nav-link:focus:not(:focus-visible) { outline: none; }
body #mp-details-side-tab.mp-details-side-tabs .nav-link:focus-visible { outline: 2px solid var(--mp-menu-focus-ring); outline-offset: 2px; }
html[data-bs-theme="dark"] body #mp-details-side-tab.mp-details-side-tabs .nav-link:not(.active) { background: #1a1d20; border-color: #3f454a; color: #c2c7cd; }
body #mp-details-side-tab.mp-details-side-tabs .nav-link:not(.active):is(:hover, :focus-visible),
html[data-bs-theme="dark"] body #mp-details-side-tab.mp-details-side-tabs .nav-link:not(.active):is(:hover, :focus-visible) {
    background: var(--mp-toolbar-pill-hover-bg);
    border-color: var(--mp-toolbar-pill-hover-border);
    color: var(--mp-toolbar-pill-hover-text);
}
body #mp-details-side-tab.mp-details-side-tabs .nav-link:not(.active):active,
html[data-bs-theme="dark"] body #mp-details-side-tab.mp-details-side-tabs .nav-link:not(.active):active {
    background: var(--mp-btn-icon-bg-active);
    border-color: transparent;
    color: var(--mp-btn-icon-text-active);
}
body #mp-details-side-tab.mp-details-side-tabs .nav-link.active:active {
    background: var(--mp-btn-primary-bg-active);
    border-color: var(--mp-btn-primary-bg-active);
}
body .mp-details-side-tab-content > :is(#mp-details-playlist, #mp-details-transcript, #mp-details-notes) > :is(.mp-details-playlist, .mp-details-transcript, .mp-details-notes) {
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 16px;
}
body .mp-details-toolbar .search-block-right { min-width: 0; }
body .mp-details-toolbar .mp-toolbar-controls { flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
/* The dock return marker is structural and must not consume a flex gap. */
body .mp-details-toolbar .mp-details-side-tabs-home { display: none; }
/* Hidden legacy actions must not reserve a trailing flex gap or margin. */
body .search-block.search-page.mp-toolbar-only.mp-details-toolbar .mp-toolbar-actions {
    display: contents;
    margin: 0;
}
@media (max-width: 1024px), (max-width: 1180px) and (orientation: portrait) {
    /* Never paint tabs in their desktop toolbar slot on mobile. */
    body .mp-details-toolbar #mp-details-side-tab { display: none; }
    /* On tablet/mobile the tabs move out of the toolbar. Scripts and templates
       left in the action slot must not reserve a second row below the back link. */
    body.page-details .search-block.search-page.mp-toolbar-only.mp-details-toolbar > .mp-toolbar-row > .search-block-right:not(:has(.mp-toolbar-actions > :not(script, template, [hidden]))) {
        display: none;
    }
    body.page-details .search-block.search-page.mp-toolbar-only.mp-details-toolbar .mp-toolbar-left {
        margin-block-end: 0;
    }
    body .mp-details-series > #mp-details-side-tab {
        width: 100%;
        margin: 0 0 12px !important;
        border: 0 !important;
    }
}

body .mp-details.mp-theater-mode > .mp-details-series > #mp-details-side-tab {
    width: 100%;
    margin: 0 0 12px;
    border: 0;
}

/* Desktop: align navigation with the sidebar's 58% / 2% / 40% columns.
   Match the BIB :has(header) override's specificity so it cannot restore flex. */
@media (min-width: 1025px) and (orientation: landscape), (min-width: 1181px) {
    body.page-details:is([data-template="bib"], [data-template="ilias"]) .search-block.search-page.mp-toolbar-only.mp-details-toolbar > .mp-toolbar-row {
        display: grid !important;
        grid-template-columns: minmax(0, 58fr) minmax(0, 40fr) !important;
        column-gap: 2%;
        align-items: center;
    }
    body.page-details:is([data-template="bib"], [data-template="ilias"]) .search-block.search-page.mp-toolbar-only.mp-details-toolbar > .mp-toolbar-row > .mp-toolbar-left {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        width: auto;
        justify-self: stretch;
    }
    body.page-details:is([data-template="bib"], [data-template="ilias"]) .search-block.search-page.mp-toolbar-only.mp-details-toolbar > .mp-toolbar-row > .mp-details-search {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    body.page-details:is([data-template="bib"], [data-template="ilias"]) .search-block.search-page.mp-toolbar-only.mp-details-toolbar > .mp-toolbar-row > .search-block-right {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        margin-left: 0;
        justify-self: stretch;
        justify-content: flex-start;
    }
    body .search-block.search-page.mp-toolbar-only.mp-details-toolbar .mp-toolbar-controls {
        width: 100%;
        justify-content: flex-start;
    }
}
@media (max-width: 800px) {
    body .mp-details-toolbar .mp-toolbar-row .search-block-right { align-self: stretch; width: 100%; }
    body .mp-details-toolbar .mp-toolbar-controls { width: 100%; }
    body.page-details .search-block.search-page.mp-toolbar-only.mp-details-toolbar .mp-toolbar-row { row-gap: 12px; }
    body.page-details .mp-details-toolbar .search-block-right:not(:has(.mp-details-side-tabs)) { margin-top: 0; }
}

/* Theater: only the stage is full-bleed; metadata and sidebar retain columns. */
@media (min-width: 1025px) and (orientation: landscape), (min-width: 1181px) {
    body .mp-details.mp-theater-mode {
        display: grid;
        grid-template-columns: minmax(0, 58fr) minmax(0, 40fr);
        column-gap: 2%;
        row-gap: 24px;
        align-items: start;
        box-sizing: border-box;
        --mp-theater-content-gutter: max(2.1875rem, calc((100vw - 1650px) / 2));
        padding-inline: var(--mp-theater-content-gutter) !important;
    }
    body .mp-details.mp-theater-mode::after { display: none; }
    body .mp-details.mp-theater-mode > #video-container {
        grid-column: 1 / -1;
        width: calc(100% + 2 * var(--mp-theater-content-gutter));
        max-width: none;
        margin-inline: calc(-1 * var(--mp-theater-content-gutter));
        border-radius: 0;
    }
    body .mp-details.mp-theater-mode > #video-container .video-js:not(.vjs-fullscreen) { border-radius: 0; }
    body .mp-details.mp-theater-mode > .mp-details-main,
    body .mp-details.mp-theater-mode > .mp-details-series {
        float: none;
        clear: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0;
    }
    body .mp-details.mp-theater-mode > .mp-details-main { grid-column: 1; }
    body .mp-details.mp-theater-mode > .mp-details-series { grid-column: 2; }
    body .mp-details.mp-theater-mode .mp-details-main :is(.mp-details-title-row, .mp-details-tabs-toolbar, #mp-tab-content, .mp-info-new) {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Playlist display settings use the library's next/back menu pattern. */
body .mp-playback-controls [data-playback-page-size-options] { margin: 0; padding: 0; }
body .mp-details-series-header .mp-playback-controls [data-playback-page-size-options] .sort-dropdown-item {
    min-height: 40px;
    padding: 9px 12px;
    gap: 12px;
    border-radius: 8px;
}
body .mp-details-series-header .mp-playback-controls [data-playback-page-size-options] .sort-dropdown-item.active::after { content: none; }
body .mp-playback-controls .mp-playback-display-check { margin-left: auto; visibility: hidden; flex: 0 0 16px; }
body .mp-playback-controls .active > .mp-playback-display-check { visibility: visible; }
body .mp-playback-controls [data-playback-display-back] > svg { flex: 0 0 16px; color: #68757b; }
html[data-bs-theme="dark"] body .mp-playback-controls [data-playback-display-back] > svg { color: #aab3bc; }
body .mp-playback-controls [data-playback-page-size-open] > span { flex: 1; text-align: left; }
body .mp-playback-controls [data-playback-page-size-open] > svg { flex-shrink: 0; }
body .mp-playback-controls [data-playback-page-size-open][aria-expanded] > .mp-playback-page-size-caret { transform: none; }

/* Publish and help share a group, including in the guest menu. */
body .navigation-profile .navigation-profile-menu ul li.mp-profile-publish {
    border-top: 1px solid var(--mp-menu-header-divider);
    margin-top: 6px;
    padding: 6px 0 0;
}
body .navigation-profile .navigation-profile-menu ul li.mp-profile-publish + li.help-link-mobile {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

/* Keep a gap on both sides of each divider so row highlights never touch it. */
body .navigation-profile > .navigation-profile-menu:not(.has-subview) > ul:has(> .navigation-profile-user) > li.navigation-profile-user {
    margin: 0 0 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--mp-menu-header-divider);
}
body .navigation-profile > .navigation-profile-menu > ul > li.navigation-profile-user .profile-meta-name {
    font-weight: var(--mp-menu-title-weight);
    overflow-wrap: anywhere;
}
body .navigation-profile > .navigation-profile-menu:not(.has-subview) > ul:has(> .navigation-profile-user) > li:not(.navigation-breadcrumb, .navigation-profile-user) > :is(a, button) {
    gap: 10px;
}
body .navigation-profile > .navigation-profile-menu:not(.has-subview) > ul:has(> .navigation-profile-user) > li.mp-profile-color-mode {
    margin-block-end: 0;
}
body .navigation-profile > .navigation-profile-menu:not(.has-subview) > ul:has(> .navigation-profile-user) > li:is(.mp-profile-language-link, .help-link-mobile, .mp-profile-logout):not(.mp-profile-publish + .help-link-mobile) {
    margin-block-start: 6px;
    padding-block-start: 6px;
    border-top: 1px solid var(--mp-menu-header-divider);
}

/* Keyboard focus contract for menu triggers and entries. An inset ring remains
   visible inside scrolling panels and does not change control dimensions. */
:root { --mp-menu-focus-ring: #007f6e; }
html[data-bs-theme="dark"] { --mp-menu-focus-ring: #71dfca; }
body :is(
    .btn-sort-icon, .mp-library-sort-trigger, .mp-toolbar-rail-trigger,
    .mp-display-trigger, #mp-display-button,
    [data-playback-source-trigger],
    details.mp-media-actions > summary,
    .mp-playlist-menu > summary, .mp-library-group-menu > summary,
    .mp-library-note-menu > summary, .mp-my-notes-single-menu > summary,
    .mp-notifications-actions > summary, .mp-notifications-item-actions,
    .mp-notes-toolbar-btn--more,
    .sort-dropdown-menu .sort-dropdown-item,
    .mp-media-actions-panel button, .mp-media-actions-panel a,
    .mp-playlist-menu-panel button, .mp-playlist-menu-panel a,
    .mp-library-section-actions button,
    .mp-display-panel button, .mp-display-columns button,
    .mp-notifications-actions-menu > button,
    .mp-notifications-item-actions-popup > button,
    .mp-notes-more-menu__item
):not(:disabled):not([aria-disabled="true"]):not(.is-disabled):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: -2px !important;
}

/* Pointer press uses a stronger fill, without an extra edge. Keyboard focus
   and persistent selection keep their own indicators. */
:root {
    --mp-menu-control-open-bg: #e9edef;
    --mp-menu-control-pressed-bg: #d6dfe3;
}
html[data-bs-theme="dark"] {
    --mp-menu-control-open-bg: #30383d;
    --mp-menu-control-pressed-bg: #445159;
}
body :is(
    .btn-sort-icon, .mp-library-sort-trigger, .mp-display-trigger, #mp-display-button,
    .mp-notifications-item-actions, .mp-notes-toolbar-btn--more,
    [data-playback-source-trigger]
)[aria-expanded="true"],
body :is(.mp-media-actions, .mp-playlist-menu, .mp-library-group-menu, .mp-library-note-menu,
    .mp-my-notes-single-menu, .mp-notifications-actions)[open] > summary {
    background: var(--mp-menu-control-open-bg) !important;
}
body :is(
    .btn-sort-icon, .mp-library-sort-trigger, .mp-toolbar-rail-trigger,
    .mp-display-trigger, #mp-display-button,
    [data-playback-source-trigger],
    details.mp-media-actions > summary,
    .mp-playlist-menu > summary, .mp-library-group-menu > summary,
    .mp-library-note-menu > summary, .mp-my-notes-single-menu > summary,
    .mp-notifications-item-actions, .mp-notes-toolbar-btn--more,
    .sort-dropdown-menu .sort-dropdown-item,
    .mp-media-actions-panel button, .mp-media-actions-panel a,
    .mp-playlist-menu-panel button, .mp-playlist-menu-panel a,
    .mp-library-section-actions button, .mp-display-panel button,
    .mp-display-columns button, .mp-notifications-actions-menu > button,
    .mp-notifications-item-actions-popup > button, .mp-notes-more-menu__item,
    .mp-profile-settings-sort > summary, .mp-profile-settings-sort-panel > button,
    .mp-profile-window-panel button, .mp-library-display-choices > button,
    .mp-my-notes-remove-item, .mp-my-notes-remove-item-single,
    .mp-bookmarks-remove-item, .mp-recent-remove-item,
    .mp-bookmarks-clear-all, .mp-recent-clear-all, .mp-my-notes-clear-all,
    .mp-bookmarks-clear-section, .mp-recent-clear-section, .mp-my-notes-clear-section
):not(:disabled):not([aria-disabled="true"]):not(.is-disabled):active {
    background: var(--mp-menu-control-pressed-bg) !important;
    box-shadow: none !important;
}

/* A pointer press overlaps :hover. Override legacy hover accents on ordinary
   menu rows, but leave persistent selection and destructive actions alone. */
html body :is(
    .sort-dropdown-menu .sort-dropdown-item,
    #mp-display-panel :is(.mp-display-option, .mp-display-columns button),
    .mp-media-actions-panel > :is(a, button),
    .mp-notes-more-menu__item,
    #mp-playlists-modal .mp-playlist-menu-panel > :is(a, button),
    #mp-playlists-modal .mp-library-section-actions > button,
    #mp-playlists-modal .mp-library-display-choices > button,
    .mp-notifications-panel .mp-notifications-actions-menu > button,
    .mp-notifications-item-actions-popup > button,
    .mp-profile-window-panel button, .mp-profile-settings-sort-panel button
):not(:disabled, [aria-disabled="true"], .is-disabled):not(
    .active, .is-active, .is-selected, [aria-selected="true"], [aria-pressed="true"], [aria-current]:not([aria-current="false"]),
    .mp-playlist-menu-danger, .mp-notes-more-menu__item--danger, .mp-notifications-dismiss-all, .is-danger, .mp-bookmark-btn--menu.is-bookmarked,
    .mp-profile-settings-btn--reset, .header-apps-restore-btn,
    [class*="remove"], [class*="clear"], [class*="delete"]
):active {
    color: var(--mp-control-pressed-text) !important;
}

/* The episode footer uses the same primary pill as the detail dialogs. */
#series-load-more-button.mp-load-more-btn {
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid var(--mp-btn-primary-bg);
    border-radius: 999px;
    background: var(--mp-btn-primary-bg);
    color: var(--mp-btn-primary-text);
    font-size: var(--mp-toolbar-pill-font-size);
    font-weight: var(--mp-toolbar-pill-font-weight);
    line-height: 20px;
    letter-spacing: normal;
}
#series-load-more-button.mp-load-more-btn:hover:not(:disabled) {
    border-color: var(--mp-btn-primary-bg-hover);
    background: var(--mp-btn-primary-bg-hover);
}
#series-load-more-button.mp-load-more-btn:active:not(:disabled) {
    border-color: var(--mp-btn-primary-bg-active);
    background: var(--mp-btn-primary-bg-active);
    box-shadow: none;
}
.mp-details #search-results-pagination .mp-search-pagination-page-value {
    gap: 3px;
}
.mp-details #search-results-pagination :is(.mp-search-pagination-arrow, .mp-search-pagination-page) {
    min-width: 22px;
    min-height: 22px;
    padding-inline: 3px;
    border-radius: 999px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
/* Give both numbers the same compact footprint next to their chevrons. */
.mp-details #search-results-pagination :is(.mp-search-pagination-page, .mp-search-pagination-total) {
    min-width: 18px;
    padding-inline: 3px;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}
.mp-details #search-results-pagination .mp-search-pagination-page {
    min-height: 18px;
}
.mp-details #search-results-pagination :is(.mp-search-pagination-arrow, .mp-search-pagination-page):hover:not(:disabled) {
    background: var(--mp-menu-hover-bg);
}
.mp-details #search-results-pagination .mp-search-pagination-page:active:not(:disabled) {
    background: var(--mp-menu-control-pressed-bg);
    color: var(--mp-btn-icon-text-active);
}
#series-load-more-button.mp-load-more-btn:focus-visible,
.mp-details #search-results-pagination :is(.mp-search-pagination-arrow, .mp-search-pagination-page):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
    box-shadow: none;
}

/* Menu and preview audio triggers use the same filled feedback as the toolbar. */
body :is(
    .mp-hover-preview-mute,
    .mp-search-pagination-arrow, .mp-series-rail__arrow,
    .mp-playback-controls .mp-series-arrow[href]:not(.disabled),
    .btn-sort-icon, .mp-library-sort-trigger, .mp-toolbar-rail-trigger,
    .mp-display-trigger, #mp-display-button,
    [data-playback-source-trigger],
    details.mp-media-actions > summary,
    .mp-playlist-menu > summary, .mp-library-group-menu > summary,
    .mp-library-note-menu > summary, .mp-my-notes-single-menu > summary,
    .mp-notifications-item-actions, .mp-notes-toolbar-btn--more
):not(:disabled):not([aria-disabled="true"]):not(.is-disabled):not(.is-unavailable):active {
    background: var(--mp-menu-control-pressed-bg) !important;
    color: var(--mp-btn-icon-text-active) !important;
    box-shadow: none !important;
}

/* Expand/collapse controls share launcher press feedback as well. Group
   chevrons are decorative spans; their actual keyboard target is the summary. */
body :is(button.mp-playlist-toggle, .mp-playlist-chevron, .mp-my-notes-toggle-notes,
    summary.mp-bookmarks-group-header, summary.mp-bookmarks-section-header):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: -2px !important;
}
body :is(button.mp-playlist-toggle, .mp-playlist-chevron, .mp-my-notes-toggle-notes):not(:disabled):not([aria-disabled="true"]):active,
body :is(summary.mp-bookmarks-group-header, summary.mp-bookmarks-section-header):active .mp-library-group-chevron {
    background: var(--mp-btn-icon-bg-active) !important;
    color: var(--mp-btn-icon-text-active) !important;
    box-shadow: none !important;
}

/* The player sidepanel is always dark, independently of the page theme.
   Popovers remain descendants of the panel even in the browser top layer. */
body .video-js .vjs-kit-fs-sidepanel {
    --mp-menu-text: #e3e6e9;
    --mp-menu-muted: #a4afb8;
    --mp-menu-hover-bg: #292f33;
    --mp-menu-action-color: var(--mp-menu-text);
    --mp-menu-action-icon-color: var(--mp-menu-muted);
    --mp-menu-danger-color: #ffb4ab;
    --mp-menu-danger-hover-bg: #412a2c;
    --mp-danger-pressed-bg: #563336;
    --mp-danger-pressed-text: #ffb4ab;
    --mp-menu-danger-disabled-color: var(--mp-menu-muted);
    --mp-menu-focus-ring: #71dfca;
    --mp-menu-control-open-bg: #30383d;
    --mp-menu-control-pressed-bg: #445159;
    --mp-btn-icon-bg-active: #343b42;
    --mp-control-pressed-text: #e3e6e9;
    --mp-btn-icon-text-active: var(--mp-control-pressed-text);
    --mp-sidepanel-selected-bg: #193334;
    --mp-sidepanel-selected-hover-bg: #214142;
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__tab:is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg);
    color: var(--mp-menu-text);
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__tab.is-active:is(:hover, :focus-visible) {
    background: var(--mp-sidepanel-selected-bg);
    color: #fff;
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__tab[role="tab"]:active {
    background: var(--mp-btn-icon-bg-active);
    color: var(--mp-btn-icon-text-active);
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__tab:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: -3px;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="transcript"] .mp-details-transcript .mp-transcript-row:hover {
    background: transparent;
}
body .vjs-kit-fs-sidepanel__pane[data-pane="transcript"] .mp-details-transcript .mp-transcript-row--active .mp-transcript-line,
body .vjs-kit-fs-sidepanel__pane[data-pane="transcript"] .mp-details-transcript .mp-transcript-row--active .mp-transcript-line::before {
    background: var(--mp-sidepanel-selected-bg);
}
body .vjs-kit-fs-sidepanel__pane[data-pane="transcript"] .mp-details-transcript .mp-transcript-row--active:is(:hover, :focus-within) .mp-transcript-line,
body .vjs-kit-fs-sidepanel__pane[data-pane="transcript"] .mp-details-transcript .mp-transcript-row--active:is(:hover, :focus-within) .mp-transcript-line::before {
    background: var(--mp-sidepanel-selected-hover-bg);
}
body .vjs-kit-fs-sidepanel__pane .mp-transcript-bilang-tag--de {
    color: #71dfca;
}
body .vjs-kit-fs-sidepanel__pane .mp-transcript-bilang-tag--en {
    color: #95c2ff;
}
body .video-js .vjs-kit-fs-sidepanel__pane :is(.mp-media-actions-panel, .sort-dropdown-menu, .mp-notes-more-menu) {
    background: #1a1d20 !important;
    color: #e3e6e9 !important;
    border: 1px solid #353a3f !important;
    border-radius: 12px;
    box-shadow: none;
    font-family: inherit;
}
body .video-js .vjs-kit-fs-sidepanel__pane :is(details.mp-media-actions > summary, .mp-notes-toolbar-btn--more),
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] :is(#detailsSortDropdownMenuButton, #mp-details-page-size-button, .mp-playback-title-line, .btn-sort-icon, .mp-series-arrow) {
    background: transparent !important;
    color: #b7bdc4 !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-title-line .mp-playback-heading {
    color: #e3e6e9;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] :is(#detailsSortDropdownMenuButton, #mp-details-page-size-button, .mp-playback-title-line, .btn-sort-icon, .mp-series-arrow):not(:disabled):not(.disabled):is(:hover, :focus-visible, [aria-expanded="true"]),
body .video-js .vjs-kit-fs-sidepanel__pane :is(details.mp-media-actions > summary, .mp-notes-toolbar-btn--more):is(:hover, :focus-visible),
body .video-js .vjs-kit-fs-sidepanel__pane :is(details.mp-media-actions[open] > summary, .mp-notes-toolbar-btn--more[aria-expanded="true"]) {
    background: #30383d !important;
    color: #e3e6e9 !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] :is(#detailsSortDropdownMenuButton, #mp-details-page-size-button, .mp-playback-title-line, .btn-sort-icon, .mp-series-arrow):not(:disabled):not(.disabled):active,
body .video-js .vjs-kit-fs-sidepanel__pane :is(details.mp-media-actions > summary, .mp-notes-toolbar-btn--more):active {
    background: var(--mp-menu-control-pressed-bg) !important;
    color: var(--mp-btn-icon-text-active) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane :is(.mp-media-actions-panel > button, .mp-media-actions-panel > a, .sort-dropdown-item, .mp-notes-more-menu__item):not(.mp-playlist-menu-danger, .mp-notes-more-menu__item--danger) {
    color: var(--mp-menu-text) !important;
    font-size: var(--mp-menu-entry-size) !important;
    font-weight: var(--mp-menu-entry-weight) !important;
    line-height: var(--mp-menu-entry-line-height) !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] #details-sort-dropdown-menu .sort-dropdown-item {
    background: transparent !important;
    color: var(--mp-menu-text) !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] #details-sort-dropdown-menu .sort-dropdown-item:is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg) !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] #details-sort-dropdown-menu .sort-dropdown-item.active {
    color: var(--mp-menu-focus-ring) !important;
    background: var(--mp-sidepanel-selected-bg) !important;
    -webkit-text-fill-color: currentColor !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] #details-sort-dropdown-menu .sort-dropdown-item.active:is(:hover, :focus-visible) {
    background: var(--mp-sidepanel-selected-hover-bg) !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] #details-sort-dropdown-menu .sort-dropdown-item:not(:disabled):active {
    background: var(--mp-menu-control-pressed-bg) !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] :is(.mp-playback-source-heading, .mp-playback-switch-status, .mp-playback-source-count) {
    color: var(--mp-menu-muted);
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-source-panel .mp-playback-source-option {
    color: var(--mp-menu-text);
    border-radius: 8px;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-source-option:not(:disabled):is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg);
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-source-option:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: -2px;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-source-option[aria-current="true"] {
    color: var(--mp-menu-focus-ring);
    background: var(--mp-sidepanel-selected-bg);
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-source-option[aria-current="true"]:is(:hover, :focus-visible) {
    background: var(--mp-sidepanel-selected-hover-bg);
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-source-check {
    color: var(--mp-menu-focus-ring);
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] :is(#mp-details-page-size-menu, #details-sort-dropdown-menu).sort-dropdown-menu {
    left: auto !important;
    right: 0 !important;
}
body .video-js .vjs-kit-fs-sidepanel__pane :is(#mp-details-page-size-menu.sort-dropdown-menu, #details-sort-dropdown-menu.sort-dropdown-menu, .mp-notes-more-menu, .mp-playback-source-panel[popover]) {
    box-sizing: border-box;
    width: min(260px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    padding: 6px;
    background: #1a1d20 !important;
    border: 1px solid #353a3f !important;
    border-radius: 12px;
    box-shadow: none;
    font-family: "Roboto", sans-serif;
}
body .video-js .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-series-arrow:not(.disabled):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: -2px !important;
}

/* Measure tooltips at their natural width before JS clamps them to the viewport. */
body .mp-tooltip {
    width: max-content;
    box-sizing: border-box;
}

/* Let the tab strip grow without pushing the close control off screen. */
body .video-js.vjs-kit-fs-sidepanel-open .vjs-kit-fs-sidepanel__tabs {
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__tab[role="tab"] {
    margin: 0;
    min-height: 44px;
    border: 0;
    border-radius: 0;
    background: transparent;
    white-space: nowrap;
    font-family: "Roboto", sans-serif;
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__tab.is-active {
    box-shadow: inset 0 -3px var(--mp-teal);
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__close {
    position: sticky;
    right: 0;
    z-index: 1;
    box-sizing: border-box;
    margin-inline-end: 10px;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: #1e2024;
    font-size: 0;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__close::before {
    content: "";
    width: 13px;
    height: 13px;
    background: linear-gradient(45deg, transparent calc(50% - 1px), currentColor 0 calc(50% + 1px), transparent 0),
                linear-gradient(-45deg, transparent calc(50% - 1px), currentColor 0 calc(50% + 1px), transparent 0);
}
body .video-js .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__close:is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg);
    color: var(--mp-menu-text);
}
@container (min-width: 360px) {
    body .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-thumb-link,
    body .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-thumb.mp-playback-thumb {
        flex-basis: clamp(132px, 35cqi, 184px);
        width: clamp(132px, 35cqi, 184px);
    }
    body .vjs-kit-fs-sidepanel__pane[data-pane="playlist"] .mp-playback-thumb-link > .mp-playback-thumb {
        width: 100%;
    }
}

/* Facet rows use the same hover surface as menu entries. */
html[data-bs-theme="dark"] #facets-containter .mp-facets-agg-list ul li:not(.mp-facets-more):hover {
    background: transparent;
}
html[data-bs-theme="dark"] #facets-containter .mp-facets-agg-list a:is(:hover, :focus-visible) {
    background: #292f33;
    color: #71dfca;
}

/* Filter pills keep their primary treatment while pressed. */
body a:is(.remove-filter, .mp-reset-filters):not([aria-disabled="true"]):active {
    background: var(--mp-btn-primary-bg-active, #006b58) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
}
body a:is(.remove-filter, .mp-reset-filters):not([aria-disabled="true"]):active :is(span, i) {
    color: inherit !important;
}

/* Destructive menu rows deepen their hover tint on press, without inverting the label. */
:root {
    --mp-menu-action-color: #20272b;
    --mp-menu-action-icon-color: #68757b;
    --mp-menu-danger-color: #b42318;
    --mp-menu-danger-hover-bg: #fdecec;
    --mp-danger-pressed-bg: #f8d7d5;
    --mp-danger-pressed-text: #8e1c14;
    --mp-menu-danger-disabled-color: #626b75;
}
html[data-bs-theme="dark"] {
    --mp-menu-action-color: #e3e6e9;
    --mp-menu-action-icon-color: #aab3bc;
    --mp-menu-danger-color: #ffb4ab;
    --mp-menu-danger-hover-bg: #412a2c;
    --mp-danger-pressed-bg: #563336;
    --mp-danger-pressed-text: #ffb4ab;
    --mp-menu-danger-disabled-color: #aab3bc;
}
:is(.mp-playlist-menu-danger, .mp-notes-more-menu__item--danger,
    .mp-notifications-dismiss-all, .mp-notifications-item-actions-popup > button.is-danger,
    .mp-my-notes-remove-item, .mp-my-notes-remove-item-single,
    .mp-bookmarks-remove-item, .mp-recent-remove-item,
    .mp-bookmarks-clear-all, .mp-recent-clear-all, .mp-my-notes-clear-all,
    .mp-bookmarks-clear-section, .mp-recent-clear-section, .mp-my-notes-clear-section) {
    color: var(--mp-menu-action-color) !important;
    --mp-menu-destructive-icon-color: var(--mp-menu-action-icon-color);
    background: transparent !important;
}
:is(.mp-playlist-menu-danger, .mp-notes-more-menu__item--danger,
    .mp-notifications-dismiss-all, .mp-notifications-item-actions-popup > button.is-danger,
    .mp-my-notes-remove-item, .mp-my-notes-remove-item-single,
    .mp-bookmarks-remove-item, .mp-recent-remove-item,
    .mp-bookmarks-clear-all, .mp-recent-clear-all, .mp-my-notes-clear-all,
    .mp-bookmarks-clear-section, .mp-recent-clear-section, .mp-my-notes-clear-section):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible) {
    color: var(--mp-menu-danger-color) !important;
    --mp-menu-destructive-icon-color: currentColor;
    background: var(--mp-menu-danger-hover-bg) !important;
}
:is(.mp-playlist-menu-danger, .mp-notes-more-menu__item--danger,
    .mp-notifications-dismiss-all, .mp-notifications-item-actions-popup > button.is-danger,
    .mp-my-notes-remove-item, .mp-my-notes-remove-item-single,
    .mp-bookmarks-remove-item, .mp-recent-remove-item,
    .mp-bookmarks-clear-all, .mp-recent-clear-all, .mp-my-notes-clear-all,
    .mp-bookmarks-clear-section, .mp-recent-clear-section, .mp-my-notes-clear-section):is(:disabled, [aria-disabled="true"]) {
    color: var(--mp-menu-danger-disabled-color) !important;
    --mp-menu-destructive-icon-color: currentColor;
    background: transparent !important;
    opacity: .45;
}
:is(.mp-playlist-menu-danger, .mp-notes-more-menu__item--danger,
    .mp-notifications-dismiss-all, .mp-notifications-item-actions-popup > button.is-danger,
    .mp-my-notes-remove-item, .mp-my-notes-remove-item-single,
    .mp-bookmarks-remove-item, .mp-recent-remove-item,
    .mp-bookmarks-clear-all, .mp-recent-clear-all, .mp-my-notes-clear-all,
    .mp-bookmarks-clear-section, .mp-recent-clear-section, .mp-my-notes-clear-section) svg {
    color: var(--mp-menu-destructive-icon-color) !important;
}

/* Profile settings use the library's surfaces, typography and controls. */
.mp-profile-settings-modal,
.mp-profile-crop-modal,
#mp-add-to-playlist-modal {
    --mp-profile-surface: #fff;
    --mp-profile-subtle: #f8f9fa;
    --mp-profile-muted: #626d76;
    --mp-profile-hover: #f1f3f4;
    --mp-profile-accent: #006858;
}
html[data-bs-theme="dark"] :is(.mp-profile-settings-modal, .mp-profile-crop-modal, #mp-add-to-playlist-modal) {
    --mp-profile-surface: #1a1d20;
    --mp-profile-subtle: #212529;
    --mp-profile-muted: #aab3bc;
    --mp-profile-hover: #292f33;
    --mp-profile-accent: #71dfca;
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) .modal-content {
    border-radius: 12px;
    border: 1px solid var(--mp-menu-header-divider);
    background: var(--mp-profile-surface);
    color: var(--mp-menu-action-color);
    overflow: hidden;
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) .modal-header {
    align-items: center;
    gap: 12px;
    min-height: 64px;
    box-sizing: border-box;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mp-menu-header-divider);
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) .modal-title,
body #mp-add-to-playlist-modal .modal-title {
    margin: 0;
    min-width: 0;
    font-size: var(--mp-menu-title-size) !important;
    font-weight: var(--mp-menu-title-weight) !important;
    line-height: 1.4;
    color: var(--mp-menu-action-color) !important;
}
#mp-add-to-playlist-modal .modal-title { overflow-wrap: anywhere; }
body .mp-profile-settings-modal .modal-header .close,
body .mp-profile-crop-modal .mp-profile-crop-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 40px;
    box-sizing: border-box;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--mp-profile-subtle) !important;
    opacity: 1;
    transform: none;
}
/* Dedicated class avoids legacy .close rules that hide children or draw bars. */
body .mp-profile-settings-modal .mp-profile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f3f4;
    color: #465159;
    cursor: pointer;
}
body .mp-profile-settings-modal .mp-profile-close > svg { display: block; visibility: visible; flex: 0 0 20px; width: 20px; height: 20px; }
body .mp-profile-settings-modal .mp-profile-close:is(:hover, :focus-visible) { background: #e5e9eb; }
html[data-bs-theme="dark"] body .mp-profile-settings-modal .mp-profile-close { background: #212529; color: #b7bdc4; }
html[data-bs-theme="dark"] body .mp-profile-settings-modal .mp-profile-close:is(:hover, :focus-visible) { background: #272b2f; }
body .mp-profile-crop-modal .mp-profile-crop-back { margin: 0 !important; color: var(--mp-menu-action-icon-color); }
body .mp-profile-settings-modal .modal-header .close:is(:hover, :focus-visible),
body .mp-profile-crop-modal .mp-profile-crop-back:is(:hover, :focus-visible) {
    background: var(--mp-profile-hover) !important;
}
body .mp-profile-crop-modal .mp-profile-crop-back:active {
    background: var(--mp-btn-icon-bg-active) !important;
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) .modal-body { padding: 16px; }
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) .modal-footer {
    padding: 12px 16px;
    gap: 8px;
    border-top: 1px solid var(--mp-menu-header-divider);
}
body .mp-profile-settings-modal .mp-profile-settings-preview {
    align-items: center;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 12px;
    border-color: var(--mp-menu-header-divider);
    background: var(--mp-profile-subtle);
}
body .mp-profile-settings-modal .mp-profile-settings-preview-name { color: var(--mp-menu-action-color); }
body .mp-profile-settings-modal .mp-profile-settings-preview-meta { color: var(--mp-profile-muted); }
body .mp-profile-settings-modal .mp-profile-settings-preview-meta strong { color: inherit; font-weight: 500; }
body .mp-profile-settings-modal .mp-profile-settings-field { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
body .mp-profile-settings-modal :is(.mp-profile-settings-label, .mp-profile-settings-sublabel) {
    float: none;
    width: auto;
    margin: 0 0 8px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
    color: var(--mp-menu-action-color);
}
body .mp-profile-settings-modal .mp-profile-settings-sublabel { margin-top: 12px; }
body .mp-profile-settings-modal .mp-profile-settings-input.form-control {
    box-sizing: border-box;
    min-height: 44px;
    height: auto;
    padding: 10px 12px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 8px;
    background-color: var(--mp-profile-surface);
    color: var(--mp-menu-action-color);
    font-size: 14px;
    line-height: 1.5;
}
body .mp-profile-settings-modal .mp-profile-settings-input.form-control:is(:hover, :active, :focus) {
    border-color: var(--mp-profile-muted) !important;
}
#mp-playlists-modal :is(#mp-playlists-new-name, #mp-playlists-description):is(:hover, :active, :focus) {
    border-color: var(--mp-toolbar-pill-hover-border) !important;
}
body .mp-profile-settings-modal .mp-profile-settings-input.form-control:focus,
#mp-playlists-modal :is(#mp-playlists-new-name, #mp-playlists-description):focus {
    outline: 1px solid transparent !important;
    outline-offset: 2px;
    box-shadow: none !important;
}
@media (forced-colors: active) {
    body .mp-profile-settings-modal .mp-profile-settings-input.form-control:focus-visible,
    #mp-playlists-modal :is(#mp-playlists-new-name, #mp-playlists-description):focus-visible {
        outline-color: Highlight !important;
    }
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) :is(.mp-profile-settings-btn, .mp-profile-language-option, .mp-profile-crop-action) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: none;
    text-decoration: none;
}
body .mp-profile-settings-modal .mp-profile-language-option {
    background: var(--mp-profile-surface);
    color: var(--mp-menu-action-color);
    border-color: var(--mp-menu-header-divider);
    pointer-events: auto;
}
body .mp-profile-settings-modal .mp-profile-language-option:is(:hover, .is-active) {
    background: var(--mp-profile-subtle);
    border-color: var(--mp-menu-focus-ring);
    color: var(--mp-profile-accent);
}
body .mp-profile-settings-modal :is(.mp-profile-settings-btn--reset, .mp-profile-settings-btn--remove) {
    color: var(--mp-menu-action-color) !important;
    background: transparent !important;
    border-color: transparent !important;
}
body .mp-profile-settings-modal :is(.mp-profile-settings-btn--reset, .mp-profile-settings-btn--remove):not(:disabled, [aria-disabled="true"], .is-disabled):is(:hover, :focus-visible):not(:active) {
    color: var(--mp-menu-danger-color) !important;
    background: var(--mp-menu-danger-hover-bg) !important;
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) :is(button, a, input[type="range"]):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: 2px !important;
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) :is(.mp-profile-settings-btn--cancel, .mp-profile-language-option, .mp-profile-crop-action):not(:disabled):active {
    background: var(--mp-btn-icon-bg-active) !important;
    color: var(--mp-btn-icon-text-active) !important;
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) .mp-profile-settings-btn--submit:not(:disabled):active {
    background: #00594c !important;
    border-color: #00594c !important;
    color: #fff !important;
}
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) button:disabled { opacity: .45; cursor: not-allowed; }
body .mp-profile-settings-modal .mp-profile-color-options { gap: 8px; }
body .mp-profile-settings-modal .mp-profile-color-option { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
body .mp-profile-settings-modal .mp-profile-color-swatch { border-radius: 50%; width: 32px; height: 32px; }
body .mp-profile-settings-modal .mp-profile-color-option input:checked + .mp-profile-color-swatch {
    border-color: var(--mp-profile-surface);
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 1px;
    box-shadow: none;
}
body .mp-profile-settings-modal .mp-profile-color-option input:focus-visible + .mp-profile-color-swatch {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 4px;
}
body .mp-profile-settings-modal .mp-profile-color-option:active .mp-profile-color-swatch { opacity: .7; }
body .mp-profile-settings-modal :is(.mp-profile-settings-intro, .mp-profile-settings-hint) { color: var(--mp-profile-muted); line-height: 1.5; }
body .mp-profile-settings-modal .mp-profile-settings-intro { border-top: 0; padding-top: 0; }
body .mp-profile-settings-modal .mp-profile-settings-feedback { border-radius: 8px; }
body :is(.mp-profile-settings-modal, .mp-profile-crop-modal) [hidden] { display: none !important; }
@media (max-width: 1024px) {
    body .mp-profile-settings-modal .modal-content { border-radius: 0; }
    body .mp-profile-settings-modal .modal-header {
        padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    }
    body .mp-profile-settings-modal .modal-body {
        padding: 16px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
    }
    body .mp-profile-settings-modal .modal-footer {
        padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    }
}

/* User-specific notification switches. Native checkboxes retain keyboard semantics. */
body .mp-profile-settings-modal .mp-profile-notification-options { margin: 20px 0 12px; }
body .mp-profile-settings-modal .mp-profile-notification-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--mp-menu-header-divider);
    cursor: pointer;
}
body .mp-profile-settings-modal .mp-profile-notification-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
body .mp-profile-settings-modal .mp-profile-notification-title { color: var(--mp-menu-action-color); font-size: 14px; font-weight: 500; }
body .mp-profile-settings-modal .mp-profile-notification-description { color: var(--mp-profile-muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
body .mp-profile-settings-modal .mp-profile-notification-switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 26px;
    margin: 8px 0;
    padding: 0;
    border: 1px solid var(--mp-profile-muted);
    border-radius: 999px;
    background: var(--mp-menu-control-open-bg);
    cursor: pointer;
}
body .mp-profile-settings-modal .mp-profile-notification-switch::before {
    content: '';
    display: block;
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--mp-profile-muted);
}
body .mp-profile-settings-modal .mp-profile-notification-switch:checked { background: #007f6e; border-color: #007f6e; }
body .mp-profile-settings-modal .mp-profile-notification-switch:checked::before { left: 21px; background: #fff; }
body .mp-profile-settings-modal .mp-profile-notification-switch:focus-visible { outline: 2px solid var(--mp-menu-focus-ring); outline-offset: 4px; }
body .mp-profile-settings-modal .mp-profile-notification-switch:hover { box-shadow: 0 0 0 4px var(--mp-profile-hover); }
body .mp-profile-settings-modal .mp-profile-notification-switch:active {
    background: var(--mp-menu-control-pressed-bg);
    box-shadow: none;
}
body .mp-profile-settings-modal .mp-profile-notification-switch:checked:active {
    background: #00594c;
    border-color: #00594c;
}

/* Problem reporting uses the same neutral dialog and form language as settings. */
html:has(#mp-portal-bug-modal.show) {
    overflow: hidden !important;
    scrollbar-gutter: stable;
}
body #mp-portal-bug-modal {
    /* Scroll the form, not the overlay or the page behind it. */
    padding-inline: 0 !important;
    overflow: hidden;
    --mp-bug-dialog-margin: clamp(12px, 3dvh, 24px);
    --mp-bug-dialog-height: calc(100dvh - 2 * var(--mp-bug-dialog-margin));
    --mp-bug-header-height: 60px;
    --mp-bug-form-inset: 16px;
    --mp-bug-surface: #fff;
    --mp-bug-subtle: #f8f9fa;
    --mp-bug-muted: #68757b;
    --mp-bug-option-selected: #006858;
    --mp-bug-hover: #f1f3f4;
    --mp-bug-field-hover-bg: #f5f7f8;
}
html[data-bs-theme="dark"] body #mp-portal-bug-modal {
    --mp-bug-surface: #1a1d20;
    --mp-bug-subtle: #212529;
    --mp-bug-muted: #aab3bc;
    --mp-bug-option-selected: #22dfc2;
    --mp-bug-hover: #292f33;
    --mp-bug-field-hover-bg: #24292d;
}
body #mp-portal-bug-modal .mp-portal-bug-dialog {
    width: calc(100% - 48px);
    max-width: 960px;
    height: var(--mp-bug-dialog-height);
    min-height: 0;
    margin: var(--mp-bug-dialog-margin) auto !important;
}
body #mp-portal-bug-modal.is-success .mp-portal-bug-dialog { max-width: 520px; }
body #mp-portal-bug-modal .mp-portal-bug-content {
    max-height: min(100%, 720px);
    border: 0 !important;
    border-radius: 16px;
    background: var(--mp-bug-surface);
    color: var(--mp-menu-action-color);
    overflow: hidden;
}
body #mp-portal-bug-modal .mp-portal-bug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: 16px;
    min-height: var(--mp-bug-header-height);
    padding: 8px 20px;
    border-bottom: 1px solid var(--mp-menu-header-divider);
}
body #mp-portal-bug-modal .mp-portal-bug-header .modal-title {
    margin: 0;
    color: var(--mp-menu-action-color);
    font-size: 22px;
    font-weight: var(--mp-menu-title-weight);
    line-height: 1.25;
}
body #mp-portal-bug-modal .mp-portal-bug-close-btn {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 40px;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: var(--mp-bug-subtle) !important;
}
body #mp-portal-bug-modal .mp-portal-bug-header .mp-portal-bug-close-btn {
    color: var(--mp-menu-action-color) !important;
    box-shadow: none;
}
body #mp-portal-bug-modal .mp-portal-bug-header .mp-portal-bug-close-btn > svg { visibility: visible; }
body #mp-portal-bug-modal .mp-portal-bug-header .mp-portal-bug-close-btn::before,
body #mp-portal-bug-modal .mp-portal-bug-header .mp-portal-bug-close-btn::after { content: none !important; }
body #mp-portal-bug-modal .mp-portal-bug-header .mp-portal-bug-close-btn:is(:hover, :focus-visible) { background: var(--mp-menu-hover-bg) !important; }
body #mp-portal-bug-modal .mp-portal-bug-header .mp-portal-bug-close-btn:active { background: var(--mp-menu-control-pressed-bg) !important; }
body #mp-portal-bug-modal .mp-portal-bug-pill { display: none; }
body #mp-portal-bug-modal .mp-portal-bug-hero-col {
    display: flex;
    flex: 0 0 34%;
    width: 34%;
    max-width: 34%;
    --mp-bug-hero-bg: #102f2b;
    --mp-bug-hero-ink: #bfd6d0;
    --mp-bug-art-surface: #163c35;
    --mp-bug-art-screen: #0e2824;
    --mp-bug-art-line: #40675e;
    --mp-bug-art-accent: #94d7c5;
    /* Top padding matches the form column (header height + body padding) so both start on one line. */
    padding: calc(var(--mp-bug-header-height) + var(--mp-bug-form-inset)) clamp(24px, 3.5vw, 40px) clamp(20px, 4dvh, 36px);
    background: linear-gradient(150deg, #183e36, var(--mp-bug-hero-bg) 72%);
    align-items: stretch;
    justify-content: space-between;
    gap: 32px;
}
html[data-bs-theme="dark"] body #mp-portal-bug-modal .mp-portal-bug-hero-col {
    --mp-bug-hero-bg: #102522;
    background: linear-gradient(150deg, #17342e, var(--mp-bug-hero-bg) 72%);
}
body #mp-portal-bug-modal .mp-portal-bug-hero-header { margin: 0; text-align: start; }
body #mp-portal-bug-modal .mp-portal-bug-hero-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.025em;
    text-transform: none;
    text-shadow: none;
    text-wrap: balance;
}
body #mp-portal-bug-modal .mp-portal-bug-hero-desc {
    margin: 12px 0 0;
    max-width: 31ch;
    font-size: 14px;
    line-height: 1.55;
    color: var(--mp-bug-hero-ink);
}
body #mp-portal-bug-modal .mp-portal-bug-hero-art { width: 100%; max-width: 340px; margin: 0; }
body #mp-portal-bug-modal .mp-portal-bug-svg-hero { max-height: none; }
body #mp-portal-bug-modal .mp-portal-bug-split-panel { flex-direction: row; min-height: 0; min-width: 0; overflow: hidden; flex: 1 1 auto; }
body #mp-portal-bug-modal .mp-portal-bug-body-col {
    flex: 1 1 0;
    width: 66%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    padding: 24px;
    background: var(--mp-bug-surface);
    overflow-y: auto;
}
body #mp-portal-bug-modal .mp-portal-bug-lead-title { display: none; }
body #mp-portal-bug-modal .mp-portal-bug-lead-desc { margin-bottom: 16px; font-size: 14px; line-height: 1.5; color: var(--mp-bug-muted); }
body #mp-portal-bug-modal .mp-portal-bug-form-scroll { flex: 0 0 auto; max-height: none; overflow: visible; padding: 0; margin: 0; }
body #mp-portal-bug-modal .mp-portal-bug-field { margin-bottom: 14px; }
body #mp-portal-bug-modal .mp-portal-bug-field-label { flex-wrap: wrap; gap: 6px; font-size: 14px; font-weight: 500; color: var(--mp-menu-action-color); }
body #mp-portal-bug-modal .mp-portal-bug-field-label i { color: var(--mp-bug-muted); }
body #mp-portal-bug-modal .mp-portal-bug-field-opt { color: var(--mp-bug-muted); }
body #mp-portal-bug-modal :is(.mp-portal-bug-input, .mp-portal-bug-select, .mp-portal-bug-textarea) {
    min-height: 44px;
    height: auto;
    padding: 10px 12px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 8px;
    background-color: var(--mp-bug-surface);
    color: var(--mp-menu-action-color);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: none;
}
/* Blink/WebKit can override color on autofilled fields. Keep the portal text color. */
body #mp-portal-bug-modal .mp-portal-bug-input:is(:autofill, :-webkit-autofill) {
    -webkit-text-fill-color: var(--mp-menu-action-color);
}
body #mp-portal-bug-modal .mp-portal-bug-select { padding-right: 32px; }
body #mp-portal-bug-modal .mp-portal-bug-select:has(option[value=""]:checked) { color: var(--mp-bug-muted); }
body #mp-portal-bug-modal .mp-portal-bug-textarea { min-height: 96px; }
body #mp-portal-bug-modal :is(.mp-portal-bug-input, .mp-portal-bug-select, .mp-portal-bug-textarea):not(:disabled, .is-invalid):is(:hover, :active, :focus) {
    border-color: var(--mp-toolbar-pill-hover-border);
    background-color: var(--mp-bug-field-hover-bg);
}
body #mp-portal-bug-modal :is(.mp-portal-bug-input, .mp-portal-bug-select, .mp-portal-bug-textarea):focus {
    outline: 1px solid transparent !important;
    outline-offset: 2px;
    box-shadow: none !important;
}
@media (forced-colors: active) {
    body #mp-portal-bug-modal :is(.mp-portal-bug-input, .mp-portal-bug-select, .mp-portal-bug-textarea):focus-visible {
        outline-color: Highlight !important;
    }
}
body #mp-portal-bug-modal .mp-portal-bug-grid-2col { gap: 16px; }
body #mp-portal-bug-modal .mp-portal-bug-grid-2col .mp-portal-bug-field { margin-bottom: 0; }
body #mp-portal-bug-modal .mp-portal-bug-field-error { color: var(--mp-menu-danger-color); }
body #mp-portal-bug-modal :is(.mp-portal-bug-input, .mp-portal-bug-select, .mp-portal-bug-textarea).is-invalid {
    border-color: var(--mp-menu-danger-color) !important;
    background-color: var(--mp-menu-danger-hover-bg) !important;
}
body #mp-portal-bug-modal .mp-portal-bug-feedback { border-radius: 8px; }
body #mp-portal-bug-modal .mp-portal-bug-feedback--error { color: var(--mp-menu-danger-color); background: var(--mp-menu-danger-hover-bg); border-color: var(--mp-menu-danger-color); }
body #mp-portal-bug-modal .mp-portal-bug-btn:disabled { opacity: .45; cursor: not-allowed; }
body #mp-portal-bug-modal .mp-portal-bug-micro-info { align-items: flex-start; color: var(--mp-bug-muted); line-height: 1.5; }
body #mp-portal-bug-modal .mp-portal-bug-info-icon { flex: 0 0 16px; margin-top: 1px; color: var(--mp-bug-muted); }
body #mp-portal-bug-modal .mp-portal-bug-footer { margin-top: 20px; padding-top: 16px; border-color: var(--mp-menu-header-divider); }
body #mp-portal-bug-modal .mp-portal-bug-btn { height: auto; min-height: 40px; padding: 8px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; }
body #mp-portal-bug-modal .mp-portal-bug-btn--cancel { color: var(--mp-menu-action-color) !important; background: var(--mp-bug-surface); border-color: var(--mp-menu-header-divider); }
body #mp-portal-bug-modal .mp-portal-bug-btn--cancel:is(:hover, :focus-visible) { background: var(--mp-bug-hover); border-color: var(--mp-menu-header-divider); color: var(--mp-menu-action-color) !important; }
body #mp-portal-bug-modal .mp-portal-bug-btn--cancel:active:not(:disabled) {
    background: var(--mp-menu-control-pressed-bg);
    border-color: transparent;
    color: var(--mp-btn-icon-text-active) !important;
    box-shadow: none;
}
/* Match the library's primary action, rather than inherited generic .btn hovers. */
body #mp-portal-bug-modal .mp-portal-bug-btn--submit { background: #007f6e; border-color: #007f6e; color: #fff !important; box-shadow: none; }
body #mp-portal-bug-modal .mp-portal-bug-btn--submit:is(:hover, :focus-visible):not(:disabled) { background: #006858; border-color: #006858; color: #fff !important; box-shadow: none; }
body #mp-portal-bug-modal .mp-portal-bug-btn--submit:active:not(:disabled) { background: #00594c; border-color: #00594c; color: #fff !important; }
/* Keep the same neutral chevron in all states, including validation errors. */
body #mp-portal-bug-modal .mp-portal-bug-select {
    background-image: var(--mp-bug-select-chevron);
    background-position: right 0.75rem center;
    background-size: 16px 16px;
}
html[data-bs-theme="dark"] body #mp-portal-bug-modal .mp-portal-bug-select {
    --mp-bug-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.25 6.5L8 10.25L11.75 6.5' fill='none' stroke='%23aab3bc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Style the native picker where supported; keep the platform picker elsewhere. */
@supports (appearance: base-select) and selector(::picker(select)) {
    body #mp-portal-bug-modal .mp-portal-bug-select,
    body #mp-portal-bug-modal .mp-portal-bug-select::picker(select) {
        appearance: base-select;
    }
    /* Bootstrap's .form-control uses block layout. Keep the value on one row
       and use the same right-aligned chevron as the native fallback. */
    body #mp-portal-bug-modal .mp-portal-bug-select {
        display: flex;
        align-items: center;
    }
    body #mp-portal-bug-modal .mp-portal-bug-select::picker-icon { display: none; }
    body #mp-portal-bug-modal .mp-portal-bug-select::picker(select) {
        position-area: block-end span-inline-end;
        position-try-fallbacks: flip-block;
        justify-self: start;
        box-sizing: border-box;
        inline-size: max-content;
        min-inline-size: min(216px, anchor-size(width, 216px));
        max-inline-size: min(calc(100vw - 32px), anchor-size(width, 100vw));
        margin-block: 6px;
        padding: 6px;
        border: 1px solid var(--mp-menu-header-divider);
        border-radius: 12px;
        background: var(--mp-bug-surface);
        color: var(--mp-menu-action-color);
        box-shadow: none;
    }
    body #mp-portal-bug-modal .mp-portal-bug-select option {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 40px;
        padding: 8px 12px;
        border-radius: 8px;
        font-weight: 400;
        overflow-wrap: anywhere;
    }
    body #mp-portal-bug-modal .mp-portal-bug-select option[value=""] { color: var(--mp-bug-muted); }
    /* The native checkmark reserves space even on unchecked rows unless removed from layout. */
    body #mp-portal-bug-modal .mp-portal-bug-select option:is(:not(:checked), [value=""])::checkmark { display: none; }
    body #mp-portal-bug-modal .mp-portal-bug-select option:checked:not([value=""]) {
        background: transparent;
        color: var(--mp-bug-option-selected);
    }
    body #mp-portal-bug-modal .mp-portal-bug-select option:checked:not([value=""])::checkmark {
        content: '';
        order: 1;
        flex: 0 0 var(--mp-menu-check-size);
        height: var(--mp-menu-check-size);
        margin-inline-start: auto;
        background: currentColor;
        mask: var(--mp-menu-check-image) center / contain no-repeat;
    }
    @media (forced-colors: active) {
        body #mp-portal-bug-modal .mp-portal-bug-select option:checked:not([value=""])::checkmark {
            forced-color-adjust: none;
            background: CanvasText;
        }
    }
    body #mp-portal-bug-modal .mp-portal-bug-select option:is(:hover, :focus-visible) {
        background: var(--mp-menu-hover-bg);
    }
    body #mp-portal-bug-modal .mp-portal-bug-select option:focus-visible {
        outline: 2px solid var(--mp-menu-focus-ring);
        outline-offset: -2px;
    }
    body #mp-portal-bug-modal .mp-portal-bug-select option:active {
        background: var(--mp-menu-control-pressed-bg);
    }
}
body #mp-portal-bug-modal :is(button, a):focus-visible { outline: 2px solid var(--mp-menu-focus-ring) !important; outline-offset: -2px; }
body #mp-portal-bug-modal .mp-portal-bug-success { overflow-y: auto; background: var(--mp-bug-surface); }
body #mp-portal-bug-modal .mp-portal-bug-success-icon-wrap { background: var(--mp-library-nav-active-bg); color: var(--mp-menu-focus-ring); }
body #mp-portal-bug-modal .mp-portal-bug-success-title { color: var(--mp-menu-action-color); font-weight: 500; }
body #mp-portal-bug-modal .mp-portal-bug-success-text { color: var(--mp-bug-muted); }
body #mp-portal-bug-modal [hidden] { display: none !important; }
@media (min-width: 768px) {
    /* The illustration fills the entire left edge; the header belongs to the form. */
    body #mp-portal-bug-modal:not(.is-success) .mp-portal-bug-header {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 2;
        width: 66%;
        padding-inline: 24px;
        box-sizing: border-box;
        background: var(--mp-bug-surface);
    }
    body #mp-portal-bug-modal:not(.is-success) .mp-portal-bug-body-col {
        padding: calc(var(--mp-bug-header-height) + var(--mp-bug-form-inset)) 24px 16px;
        overflow: hidden;
        justify-content: flex-start;
    }
    body #mp-portal-bug-modal .mp-portal-bug-lead-desc { flex: 0 0 auto; }
    body #mp-portal-bug-modal .mp-portal-bug-form-scroll {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 4px 6px;
        margin: -4px -6px 0;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--mp-scrollbar-thumb, #b8c0c6) transparent;
    }
    body #mp-portal-bug-modal .mp-portal-bug-footer { flex: 0 0 auto; margin-top: 12px; padding-top: 12px; }
    body #mp-portal-bug-modal .mp-portal-bug-hero-col { align-self: stretch; }
}
@media (min-width: 768px) and (max-height: 520px) {
    body #mp-portal-bug-modal .mp-portal-bug-hero-art { display: none; }
}
@media (max-width: 767.98px) {
    body #mp-portal-bug-modal .mp-portal-bug-split-panel {
        flex-direction: column;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--mp-scrollbar-thumb, #b8c0c6) transparent;
    }
    body #mp-portal-bug-modal .mp-portal-bug-hero-col { flex: 0 0 auto; width: 100%; max-width: none; padding: 16px 20px; }
    body #mp-portal-bug-modal .mp-portal-bug-hero-title { font-size: 21px; }
    body #mp-portal-bug-modal .mp-portal-bug-hero-desc { margin-top: 6px; max-width: none; }
    body #mp-portal-bug-modal .mp-portal-bug-hero-art { display: none; }
    body #mp-portal-bug-modal .mp-portal-bug-body-col { flex: 0 0 auto; width: 100%; overflow: visible; }
}
@media (max-width: 600px) {
    body #mp-portal-bug-modal .mp-portal-bug-body-col { padding: 16px 20px; }
    body #mp-portal-bug-modal .mp-portal-bug-grid-2col { grid-template-columns: minmax(0, 1fr); }
}

/* Library display settings replace the menu's root view, like profile submenus. */
body #mp-playlists-modal .mp-playlist-menu-panel.has-display-view > :not(.mp-library-display-choices) { display: none !important; }
body #mp-playlists-modal .mp-library-display-choices { margin: 0; padding: 0; border: 0; }
body #mp-playlists-modal [data-library-display-toggle][aria-expanded] > .mp-library-display-chevron { transform: none; }
body #mp-playlists-modal .mp-library-section-menu .mp-library-display-choices > button { min-height: 40px; padding: 9px 12px; border-radius: 8px; }
body #mp-playlists-modal [data-library-display-back] > svg { flex: 0 0 16px; width: 16px; height: 16px; }
body #mp-playlists-modal .mp-library-section-menu .mp-library-display-choices [data-library-display-back] > span { flex: 0 1 auto; }

/* Full-window library remains a Bootstrap overlay, not browser Fullscreen API. */
body #mp-playlists-modal[data-library-size="full"] { padding: 0 !important; }
body #mp-playlists-modal[data-library-size="full"] > .modal-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
}
body #mp-playlists-modal[data-library-size="full"] > .modal-dialog > .modal-content {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body #mp-playlists-modal .mp-library-list-heading { border-top: 1px solid var(--mp-menu-header-divider); }

/* Profile window controls mirror the library's next/back display menu. */
body .mp-profile-settings-modal .modal-header > .modal-title { margin-right: auto; }
body .mp-profile-settings-modal .mp-profile-window-menu {
    flex: 0 0 40px;
    align-self: center;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    line-height: 0;
}
body .mp-profile-settings-modal .modal-header { flex-wrap: nowrap; }
body .mp-profile-settings-modal .modal-header > .mp-profile-window-menu + .close { margin: 0 !important; }
body .mp-profile-settings-modal .mp-profile-window-menu > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    list-style: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: var(--mp-menu-action-color);
    background: transparent;
    outline: none;
    box-shadow: none;
}
/* Reset KIT's global summary arrow, green border and dotted focus decoration. */
body .mp-profile-settings-modal .mp-profile-window-menu > summary::before,
body .mp-profile-settings-modal .mp-profile-window-menu > summary::after,
body .mp-profile-settings-modal .mp-profile-window-menu > summary::-webkit-details-marker { display: none; content: none; }
body .mp-profile-settings-modal .mp-profile-window-menu > summary > svg { display: block; flex: 0 0 20px; width: 20px; height: 20px; }
body .mp-profile-settings-modal .mp-profile-window-menu > summary:is(:hover, :focus-visible),
body .mp-profile-settings-modal .mp-profile-window-menu[open] > summary { border: 0; color: var(--mp-menu-action-color); background: var(--mp-profile-hover); box-shadow: none; }
body .mp-profile-settings-modal .mp-profile-window-panel {
    position: fixed;
    inset: auto;
    margin: 0;
    box-sizing: border-box;
    width: 272px;
    max-width: calc(100vw - 16px);
    max-height: min(320px, calc(100dvh - 16px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 12px;
    background: var(--mp-profile-surface);
    color: var(--mp-menu-action-color);
    box-shadow: none;
}
body .mp-profile-settings-modal .mp-profile-window-panel button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
body .mp-profile-settings-modal .mp-profile-window-panel button:is(:hover, :focus-visible) { background: var(--mp-profile-hover); }
body .mp-profile-settings-modal .mp-profile-window-panel :is(button, summary):focus-visible,
body .mp-profile-settings-modal .mp-profile-window-menu > summary:focus-visible { outline: 2px solid #64748b; outline-offset: -2px; }
body .mp-profile-settings-modal .mp-profile-window-panel svg { flex-shrink: 0; }
body .mp-profile-settings-modal .mp-profile-window-next-icon,
body .mp-profile-settings-modal .mp-profile-window-check { margin-left: auto; }
body .mp-profile-settings-modal .mp-profile-window-check { visibility: hidden; }
body .mp-profile-settings-modal [aria-pressed="true"] > .mp-profile-window-check { visibility: visible; }
body .mp-profile-settings-modal .mp-profile-window-panel [aria-pressed="true"] { color: var(--mp-menu-focus-ring); font-weight: 500; }
body .mp-profile-settings-modal[data-profile-window="full"] { padding: 0 !important; }
body .mp-profile-settings-modal[data-profile-window="full"] > .modal-dialog { width: 100%; max-width: none; height: 100dvh; min-height: 0; margin: 0; }
body .mp-profile-settings-modal[data-profile-window="full"] > .modal-dialog > .modal-content { height: 100dvh; max-height: 100dvh; border: 0 !important; border-radius: 0; box-shadow: none; }

/* Display settings share a surface, section labels and interaction states. */
body :is(#mp-display-panel:where(.mp-display-control > *), .mp-details-series-header .mp-details-page-size-controls #mp-details-page-size-menu.sort-dropdown-menu,
    #mp-playlists-modal .mp-playlist-menu-panel.has-display-view, .mp-profile-settings-modal .mp-profile-window-panel) {
    box-sizing: border-box;
    width: min(272px, calc(100vw - 24px));
    min-width: 0;
    max-width: calc(100vw - 24px);
    padding: 6px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 12px;
    background: var(--mp-display-surface, #fff);
    box-shadow: none;
}
html[data-bs-theme="dark"] { --mp-display-surface: #1a1d20; }
body :is(#mp-display-panel .mp-display-section-title, #mp-details-page-size-menu .mp-playback-display-heading,
    #mp-playlists-modal .mp-library-size-heading, .mp-profile-settings-modal .mp-profile-window-heading) {
    margin: 0;
    padding: 6px 12px 4px;
    color: var(--mp-menu-action-icon-color);
    font: 500 12px/1.5 Roboto, sans-serif;
}
body :is(#mp-playlists-modal .mp-library-list-heading, #mp-display-panel .mp-display-section) {
    border-color: var(--mp-menu-header-divider);
}
body #mp-playlists-modal .mp-library-list-heading {
    margin-top: 8px;
    padding-top: 12px;
}
body :is(#mp-display-panel .mp-display-option, #mp-details-page-size-menu [data-playback-page-size-options] > .sort-dropdown-item,
    #mp-playlists-modal .mp-library-display-choices > button, .mp-profile-settings-modal .mp-profile-window-panel button) {
    min-height: var(--mp-menu-row-height) !important;
    font-family: Roboto, sans-serif;
    font-size: var(--mp-menu-entry-size);
    line-height: var(--mp-menu-entry-line-height);
}
/* Back is a normal menu row; keep the divider outside its interactive surface. */
body :is(#mp-details-page-size-menu [data-playback-page-size-options] > [data-playback-display-back],
    #mp-playlists-modal .mp-library-section-menu .mp-library-display-choices > [data-library-display-back],
    .mp-profile-settings-modal .mp-profile-window-panel [data-profile-window-back]) {
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 6px;
    border-radius: 8px;
}
body :is(#mp-details-page-size-menu [data-playback-display-back], #mp-playlists-modal [data-library-display-back],
    .mp-profile-settings-modal [data-profile-window-back]) + :is(.mp-playback-display-heading, .mp-library-size-heading, .mp-profile-window-heading) {
    border-top: 1px solid var(--mp-menu-header-divider);
}
body :is(#mp-details-page-size-menu [data-playback-display-back], #mp-playlists-modal [data-library-display-back],
    .mp-profile-settings-modal [data-profile-window-back]) > svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: currentColor;
}
body :is(#mp-display-panel .mp-display-option[aria-pressed="true"],
    #mp-details-page-size-menu .mp-details-page-size-item.active,
    #mp-playlists-modal .mp-library-display-choices [aria-pressed="true"],
    .mp-profile-settings-modal .mp-profile-window-panel [aria-pressed="true"]) {
    color: var(--mp-display-selected-text, #006858) !important;
}
html[data-bs-theme="dark"], body .video-js .vjs-kit-fs-sidepanel { --mp-display-selected-text: #71dfca; }
body :is(#mp-display-panel .mp-display-option, #mp-details-page-size-menu [data-playback-page-size-options] > .sort-dropdown-item,
    #mp-playlists-modal .mp-library-display-choices > button, .mp-profile-settings-modal .mp-profile-window-panel button):not(:disabled, .mp-profile-settings-btn--reset):is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg) !important;
}
body :is(#mp-display-panel .mp-display-option, #mp-details-page-size-menu [data-playback-page-size-options] > .sort-dropdown-item,
    #mp-playlists-modal .mp-library-display-choices > button, .mp-profile-settings-modal .mp-profile-window-panel button):not(:disabled):active {
    background: var(--mp-menu-control-pressed-bg) !important;
}

/* Detail previews follow the home cards; fullscreen playback stays edge-to-edge. */
.page-details .mp-details { --mp-details-surface-radius: 12px; }
.page-details .mp-details #video-container,
.page-details .mp-details #video-container .video-js:not(.kit-v10-skin, .vjs-fullscreen),
.page-details .mp-details .series-poster-container {
    border-radius: var(--mp-details-surface-radius);
    overflow: hidden;
}
/* Mask the finished player as a single layer. A rounded clip on its own can
   antialias the composited video and black backing separately on repaint. */
@supports (mask: linear-gradient(#000, #000)) {
    .page-details .mp-details:not(.mp-theater-mode) #video-container:has(.kit-v10-skin):not(:has(:fullscreen, .vjs-fullscreen)) {
        --mp-player-corner: var(--mp-details-surface-radius);
        --mp-player-middle: calc(100% - 2 * var(--mp-player-corner) + 1px);
        --mp-player-corner-fade: #000 calc(var(--mp-player-corner) - 0.5px), transparent calc(var(--mp-player-corner) + 0.5px);
        border-radius: 0;
        overflow: visible;
        mask:
            radial-gradient(circle at bottom right, var(--mp-player-corner-fade)) top left / var(--mp-player-corner) var(--mp-player-corner),
            radial-gradient(circle at bottom left, var(--mp-player-corner-fade)) top right / var(--mp-player-corner) var(--mp-player-corner),
            radial-gradient(circle at top right, var(--mp-player-corner-fade)) bottom left / var(--mp-player-corner) var(--mp-player-corner),
            radial-gradient(circle at top left, var(--mp-player-corner-fade)) bottom right / var(--mp-player-corner) var(--mp-player-corner),
            linear-gradient(#000, #000) center / var(--mp-player-middle) 100%,
            linear-gradient(#000, #000) center / 100% var(--mp-player-middle);
        mask-repeat: no-repeat;
    }
}
/* Let the outer container round the video once; the v10 skin also draws its own frame. */
.page-details .mp-details:not(.mp-theater-mode) #video-container .kit-v10-skin {
    border-radius: 0;
    --media-border-radius: 0px;
    --media-border-color: transparent;
}
.page-details .mp-details .series-poster-container .mp-series-cover { border-radius: var(--mp-details-surface-radius); }
#main-containter.mp-details .mp-info-new-desc-box {
    padding: 12px calc(var(--mp-details-meta-inset) - 1px) 8px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: var(--mp-details-surface-radius, 12px);
    background: #fff;
}
html[data-bs-theme="dark"] #main-containter.mp-details .mp-info-new-desc-box {
    background: #1a1d20;
}
/* Match the collapsed preview before JavaScript measures the available width. */
@media (scripting: enabled) {
    [data-mp-desc-collapsible]:not(.is-initialized) .mp-info-new-desc-content {
        max-block-size: 1lh;
        overflow: hidden;
    }
}
.mp-info-new-desc-toggle[hidden] {
    display: none;
}
#main-containter.mp-details .mp-info-new-desc-meta :is(.mp-info-new-meta-icon, .mp-pubdate-relative > svg) {
    flex: 0 0 20px;
    width: 20px;
    color: var(--mp-menu-muted);
}
#main-containter.mp-details .mp-info-new-desc-meta .mp-pubdate-relative > svg { height: 20px; }
#main-containter.mp-details .mp-info-new-desc-meta :is(.mp-info-new-meta-row, .mp-pubdate-relative) { gap: 10px; }
#main-containter.mp-details .mp-info-new-desc-box .mp-info-new-extra {
    margin-block-start: 10px;
    padding-block-start: 5px;
    border-block-start: 1px solid var(--mp-menu-header-divider);
}
#main-containter.mp-details .mp-info-new-desc-box .mp-info-new-extra-summary {
    min-height: 40px;
    padding: 8px 4px;
    padding-inline-start: 0;
    border-radius: 8px;
    color: var(--mp-menu-action-color);
    font-weight: 500;
    transition: background-color 160ms ease;
}
#main-containter.mp-details .mp-info-new-extra-summary .mp-info-new-extra-chevron {
    color: var(--mp-menu-muted);
}
#main-containter.mp-details .mp-info-new-meta-row--authors {
    padding-block: 4px;
    padding-inline-end: 4px;
    border-radius: 8px;
    transition: background-color 160ms ease;
}
#main-containter.mp-details .mp-info-new-meta-row--authors .mp-info-new-authors a {
    color: var(--mp-menu-action-color);
}
#main-containter.mp-details :is(.mp-info-new-extra-summary, .mp-info-new-meta-row--authors):is(:hover, :focus-visible),
#main-containter.mp-details .mp-info-new-meta-row--authors:has(a:focus-visible) {
    background: var(--mp-menu-hover-bg);
}
#main-containter.mp-details .mp-info-new-extra-summary:active,
#main-containter.mp-details .mp-info-new-meta-row--authors:has(a:active) {
    background: var(--mp-menu-control-pressed-bg);
}
#main-containter.mp-details .mp-info-new-meta-row--authors a:focus:not(:focus-visible) {
    outline: none;
}
#main-containter.mp-details .mp-info-new-meta-row--authors a:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 2px;
}
#main-containter.mp-details .mp-info-new-extra-summary:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: -2px;
}
#main-containter.mp-details .mp-info-new-desc-box .mp-info-new-extra-body {
    padding: 0 4px 4px;
    padding-inline-start: 0;
    margin-block-start: 8px !important;
}
.page-details .mp-details #video-container:has(:fullscreen),
.page-details .mp-details #video-container:has(.vjs-fullscreen),
.page-details .mp-details #video-container :fullscreen,
.page-details .mp-details #video-container .video-js.vjs-fullscreen { border-radius: 0; }

/* FAQ shares library surfaces and navigation, without accent edge stripes. */
#faq-page {
    --mp-faq-surface: #fff;
    --mp-faq-subtle: #f8f9fa;
    --mp-faq-muted: #68757b;
    --mp-faq-hover: #f1f3f4;
    --mp-faq-accent: #006858;
}
html[data-bs-theme="dark"] #faq-page {
    --mp-faq-surface: #1a1d20;
    --mp-faq-subtle: #212529;
    --mp-faq-muted: #aab3bc;
    --mp-faq-hover: #292f33;
    --mp-faq-accent: #71dfca;
}
body #faq-page { width: 100%; max-width: none; box-sizing: border-box; padding: 16px 24px 48px; color: var(--mp-menu-action-color); }
body .search-block.search-page.mp-toolbar-only.mp-faq-toolbar {
    min-height: 0;
    margin: 0;
    padding: 8px 24px;
}
/* Match the centered home/details content frame, including wide screens. */
body.page-faq main {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}
body #faq-page,
body .search-block.search-page.mp-toolbar-only.mp-faq-toolbar {
    box-sizing: border-box;
    max-width: 1720px;
    margin-inline: auto;
}
@media (min-width: 1025px) {
    body #faq-page,
    body .search-block.search-page.mp-toolbar-only.mp-faq-toolbar {
        padding-inline: 2.1875rem !important;
    }
}
body .mp-faq-toolbar .mp-toolbar-row { min-height: 32px; }
body #faq-page .faq-header { align-items: center; gap: 16px 24px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--mp-menu-header-divider); }
body #faq-page .faq-header-main { flex: 1 1 360px; min-width: 0; }
body #faq-page .faq-header-main h1 { margin: 0 0 8px; font-size: 28px; font-weight: 600; line-height: 1.3; color: var(--mp-menu-action-color); }
body #faq-page .faq-toggles { align-items: center; align-self: center; justify-content: flex-end; flex-wrap: wrap; }
body #faq-page .faq-btn-toggle { box-sizing: border-box; }
body #faq-page .faq-toggles svg { flex: 0 0 16px; }
body #faq-page .faq-intro { max-width: 80ch; }
body #faq-page .faq-intro { color: var(--mp-faq-muted); line-height: 1.5; }
body #faq-page .faq-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
body #faq-page .faq-nav {
    padding: 16px 12px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 12px;
    background: var(--mp-faq-subtle);
    box-sizing: border-box;
}
body #faq-page .faq-nav-label { margin: 0 0 12px; padding: 0 12px; font-size: 14px; font-weight: 500; letter-spacing: normal; text-transform: none; color: var(--mp-menu-action-color); }
body #faq-page .faq-nav ul { display: flex; flex-direction: column; gap: 4px; border: 0; }
body #faq-page .faq-nav-link {
    min-height: 44px;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 12px;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    color: var(--mp-faq-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
}
body #faq-page .faq-nav-link svg { flex: 0 0 18px; }
body #faq-page .faq-nav-link.active { background: var(--mp-library-nav-active-bg); color: var(--mp-faq-accent); font-weight: 600; }
body #faq-page .faq-content { gap: 32px; }
body #faq-page .faq-section { min-width: 0; }
body #faq-page .faq-section + .faq-section { padding-top: 8px; }
body #faq-page .faq-section h2 {
    margin: 0 0 12px;
    padding: 0;
    gap: 10px;
    border: 0;
    background: transparent;
    color: var(--mp-menu-action-color);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
}
body #faq-page .faq-section h2 svg { flex: 0 0 18px; color: var(--mp-faq-muted); }
body #faq-page .faq-accordion { gap: 8px; }
body #faq-page .faq-item,
body #faq-page .faq-item:first-child,
body #faq-page .faq-item:last-child,
body #faq-page .faq-item + .faq-item { border: 1px solid var(--mp-menu-header-divider); border-radius: 12px; background: var(--mp-faq-surface); }
body #faq-page .faq-question { min-height: 56px; padding: 16px 20px; background: var(--mp-faq-surface); color: var(--mp-menu-action-color); font-size: 15px; font-weight: 500; }
body #faq-page .faq-answer > :is(p, ul) { max-width: none; }
body #faq-page .faq-answer > :first-child { margin-top: 20px; }
body #faq-page .faq-answer > :last-child { margin-bottom: 24px; }
body #faq-page .faq-question[aria-expanded="true"] { background: var(--mp-faq-subtle); color: var(--mp-menu-action-color); }
body #faq-page .faq-chevron { width: 18px; height: 18px; opacity: 1; color: var(--mp-faq-muted); }
body #faq-page .faq-answer { border: 0; background: var(--mp-faq-surface); }
body #faq-page .faq-answer :is(p, ul) { margin: 16px 24px; color: var(--mp-menu-action-color); font-size: 15px; line-height: 1.8; }
body #faq-page .faq-answer strong { color: inherit; }
body #faq-page .faq-answer a { color: var(--mp-faq-accent); text-decoration: underline; }
body #faq-page :is(.faq-btn-toggle, .faq-footer-btn) { min-height: 40px; gap: 8px; border-radius: 999px; }
body #faq-page :is(.faq-btn-toggle, .faq-footer-btn--secondary) { border: 1px solid var(--mp-menu-header-divider); background: var(--mp-faq-surface); color: var(--mp-menu-action-color); }
body #faq-page :is(.faq-btn-toggle, .faq-footer-btn--secondary):is(:hover, :focus-visible) {
    background: var(--mp-toolbar-pill-hover-bg);
    border-color: var(--mp-toolbar-pill-hover-border);
    color: var(--mp-toolbar-pill-hover-text);
}
body #faq-page :is(.faq-question, .faq-nav-link):is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg);
    color: var(--mp-menu-text);
}
body #faq-page .faq-nav-link.active:is(:hover, :focus-visible):not(:active) { color: var(--mp-faq-accent); }
body #faq-page :is(.faq-question, .faq-nav-link, .faq-btn-toggle, .faq-footer-btn--secondary):active {
    background: var(--mp-btn-icon-bg-active);
    color: var(--mp-btn-icon-text-active);
    box-shadow: none;
}
body #faq-page :is(.faq-btn-toggle, .faq-footer-btn--secondary):active { border-color: transparent; }
body #faq-page .faq-question:active .faq-chevron { color: inherit; }
body #faq-page .faq-footer-btn--primary:is(:hover, :focus-visible) {
    background: var(--mp-btn-primary-bg-hover);
    color: var(--mp-btn-primary-text);
}
body #faq-page .faq-footer-btn--primary:active {
    background: var(--mp-btn-primary-bg-active);
    color: var(--mp-btn-primary-text);
}
body #faq-page :is(button, a):focus-visible { outline: 2px solid var(--mp-menu-focus-ring) !important; outline-offset: -3px; }
body #faq-page .faq-footer { border-color: var(--mp-menu-header-divider); }
@media (max-width: 768px) {
    body .search-block.search-page.mp-toolbar-only.mp-faq-toolbar { padding: 8px 16px; }
    body #faq-page { padding: 12px 16px 32px; }
    body #faq-page .faq-header { align-items: stretch; gap: 16px; }
    body #faq-page .faq-header-main { flex-basis: auto; }
    body #faq-page .faq-header-main h1 { font-size: 24px; }
    body #faq-page .faq-toggles { align-self: stretch; }
    body #faq-page .faq-question { padding: 14px 16px; }
    body #faq-page .faq-answer :is(p, ul) { margin-inline: 16px; }
    body #faq-page .faq-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    body #faq-page .faq-nav { position: static; max-height: none; margin: 0; padding: 12px; }
    body #faq-page .faq-nav ul { flex-direction: row; flex-wrap: wrap; }
    body #faq-page .faq-nav-link { border-radius: 999px; }
}
@media (prefers-reduced-motion: reduce) {
    body #faq-page :is(.faq-answer, .faq-chevron, .faq-nav-link, .faq-question) { transition: none; }
}

/* Shared library/settings navigation geometry and interaction colors. */
:root { --mp-library-nav-active-bg: #e4f3ee; }
html[data-bs-theme="dark"] { --mp-library-nav-active-bg: #1b3530; }
body #mp-playlists-modal .mp-library-tab { justify-content: flex-start; gap: 10px; }
body #mp-playlists-modal .mp-library-tab-icon { flex: 0 0 18px; width: 18px; height: 18px; color: inherit; }
body #mp-playlists-modal .mp-library-tab > span:first-of-type { flex: 1 1 auto; }
body #mp-playlists-modal .mp-library-tab.is-active { background: var(--mp-library-nav-active-bg); }
body #mp-playlists-modal .mp-library-tab:active { background: var(--mp-btn-icon-bg-active); color: var(--mp-btn-icon-text-active); }
body #mp-playlists-modal .mp-library-tab:focus-visible { outline: 2px solid var(--mp-menu-focus-ring); outline-offset: -2px; }

/* Wide settings shell with a persistent library-style section rail. */
body .mp-profile-settings-modal {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.5;
}
body .mp-profile-settings-modal .modal-dialog {
    width: calc(100% - 48px);
    max-width: 1200px;
    height: 92dvh;
    min-height: 0;
    margin: 4dvh auto;
}
body .mp-profile-settings-modal .modal-content { height: min(960px, 92dvh); border-radius: 16px; }
body .mp-profile-settings-modal .mp-profile-settings-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}
body .mp-profile-settings-modal .mp-profile-settings-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    overflow-y: auto;
    border-right: 1px solid var(--mp-menu-header-divider);
    background: var(--mp-profile-subtle);
}
body .mp-profile-settings-modal .mp-profile-settings-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--mp-menu-action-icon-color);
    text-align: left;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
}
body .mp-profile-settings-modal .mp-profile-settings-tab span,
body #mp-playlists-modal .mp-library-tab > span:first-of-type {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: normal;
    white-space: nowrap;
    text-overflow: ellipsis;
}
body .mp-profile-settings-modal .mp-profile-settings-tab svg { flex: 0 0 18px; color: var(--mp-menu-action-icon-color); }
body .mp-profile-settings-modal .mp-profile-settings-tab:hover { background: var(--mp-profile-hover); color: var(--mp-profile-accent); }
body .mp-profile-settings-modal .mp-profile-settings-tab[aria-selected="true"] {
    background: var(--mp-library-nav-active-bg);
    color: var(--mp-profile-accent);
    font-weight: 600;
}
body .mp-profile-settings-modal .mp-profile-settings-tab[aria-selected="true"] svg { color: inherit; }
body .mp-profile-settings-modal .mp-profile-settings-tab:active { background: var(--mp-btn-icon-bg-active); color: var(--mp-btn-icon-text-active); }
body .mp-profile-settings-modal .mp-profile-settings-main {
    min-width: 0;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
body .mp-profile-settings-modal [data-profile-panel] { width: 100%; max-width: none; margin: 0; }
body .mp-profile-settings-modal :is(.mp-profile-settings-field, .mp-profile-settings-preview, .mp-profile-settings-input) { width: 100%; max-width: none; box-sizing: border-box; }
body .mp-profile-settings-modal .mp-profile-settings-section-title {
    margin: 0 0 20px;
    color: var(--mp-menu-action-color);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
}
body .mp-profile-settings-modal .mp-profile-settings-info {
    padding: 20px;
    border: 1px solid var(--mp-menu-header-divider);
    border-radius: 12px;
    background: var(--mp-profile-subtle);
    color: var(--mp-profile-muted);
    font-size: 14px;
    line-height: 1.6;
}
body .mp-profile-settings-modal .mp-profile-settings-info h4 { margin: 0 0 8px; color: var(--mp-menu-action-color); font-size: 16px; font-weight: 500; }
body .mp-profile-settings-modal .mp-profile-settings-info p { margin: 0 0 12px; }
body .mp-profile-settings-modal .mp-profile-settings-policy { color: var(--mp-profile-accent); text-decoration: underline; }
@media (max-width: 1024px) {
    body .mp-profile-settings-modal .modal-dialog { width: 100%; max-width: none; height: 100dvh; margin: 0; min-height: 0; }
    body .mp-profile-settings-modal .modal-content { border-radius: 0; }
    body .mp-profile-settings-modal .modal-content { height: 100dvh; max-height: 100dvh; }
}
@media (max-width: 640px) {
    body .mp-profile-settings-modal .mp-profile-settings-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    body .mp-profile-settings-modal .mp-profile-settings-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 8px;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--mp-menu-header-divider);
    }
    body .mp-profile-settings-modal .mp-profile-settings-tab { padding: 10px 8px; gap: 6px; font-size: 13px; }
    body .mp-profile-settings-modal .mp-profile-settings-main { padding: 20px 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* Shared library/settings shell: persistent navigation and content-only scrolling. */
body .mp-profile-settings-modal .modal-content { position: relative; overflow: hidden; }
body .mp-profile-settings-modal > .modal-dialog > .modal-content > .modal-header {
    position: absolute;
    inset: 0 0 auto auto;
    z-index: 2;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px;
    border: 0;
    background: transparent;
}
body .mp-profile-settings-modal .mp-profile-settings-nav { padding: 24px 16px 16px; }
body .mp-profile-settings-modal .mp-profile-settings-nav-title {
    margin: 4px 8px 24px;
    color: var(--mp-menu-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
body .mp-profile-settings-modal .mp-profile-settings-main { padding-top: 24px; }
body .mp-profile-settings-modal .mp-profile-settings-section-title { min-height: 32px; padding-right: 96px; }
body .mp-profile-settings-modal .mp-profile-settings-main,
body .mp-profile-settings-modal .mp-profile-settings-nav {
    scrollbar-width: thin;
    scrollbar-color: var(--mp-scrollbar-thumb, #b8c0c6) transparent;
}
body .mp-profile-settings-modal .mp-profile-settings-tab,
body #mp-playlists-modal .mp-library-tab { font-size: 14px; font-weight: 400; min-height: 44px; }
body .mp-profile-settings-modal .mp-profile-settings-tab svg { width: 16px; height: 16px; flex-basis: 16px; color: inherit; }
body #mp-playlists-modal .mp-library-tab svg { width: 16px; height: 16px; }
body .mp-profile-settings-modal .modal-footer { flex-shrink: 0; }
body .mp-profile-settings-modal .mp-profile-settings-btn--upload {
    border-color: var(--mp-menu-header-divider);
    background: var(--mp-profile-surface);
    color: var(--mp-menu-text);
}
body .mp-profile-settings-modal .mp-profile-settings-btn--upload:not(:disabled):is(:hover, :focus-visible, :active) {
    border-color: var(--mp-menu-header-divider) !important;
    background: var(--mp-menu-hover-bg) !important;
    color: var(--mp-menu-text) !important;
}
body .mp-profile-settings-modal .mp-profile-settings-btn--upload:not(:disabled):active {
    background: var(--mp-menu-control-open-bg) !important;
}
html body .mp-profile-settings-modal .mp-profile-color-block.is-muted { opacity: 1; }
html body .mp-profile-settings-modal .mp-profile-color-block.is-muted .mp-profile-color-options { opacity: .5; }
@media (max-width: 640px) {
    body .mp-profile-settings-modal .mp-profile-settings-nav { padding: 16px 8px 8px; }
    body .mp-profile-settings-modal .mp-profile-settings-nav-title { grid-column: 1 / -1; margin: 4px 8px 20px; padding-right: 88px; }
    body .mp-profile-settings-modal .mp-profile-settings-main { padding-top: 20px; }
}

/* Settings toolbar and full-height library-style sidebar. */
body .mp-profile-settings-modal > .modal-dialog > .modal-content {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
}
body .mp-profile-settings-modal > .modal-dialog > .modal-content > .modal-header {
    position: static;
    grid-column: 2;
    grid-row: 1;
    display: flex;
    min-width: 0;
    border-bottom: 1px solid var(--mp-menu-header-divider);
}
body .mp-profile-settings-modal .mp-profile-settings-layout { display: contents; }
body .mp-profile-settings-modal .mp-profile-settings-nav { grid-column: 1; grid-row: 1 / 4; }
body .mp-profile-settings-modal .mp-profile-settings-main { grid-column: 2; grid-row: 2; }
body .mp-profile-settings-modal .modal-footer { grid-column: 2; grid-row: 3; justify-content: flex-end; }
.mp-profile-settings-search {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
    padding: 8px 12px; border: 1px solid var(--mp-menu-header-divider);
    border-radius: 999px; background: var(--mp-profile-subtle); color: var(--mp-menu-muted);
}
.mp-profile-settings-search svg { flex-shrink: 0; }
body .mp-profile-settings-search > .mp-search-shortcut {
    position: static;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 3px;
    width: auto;
    min-width: 0;
    height: 26px;
    min-height: 0;
    margin: 0;
    padding: 3px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--mp-menu-muted, #68757b);
    box-shadow: none;
    cursor: pointer;
}
body .mp-profile-settings-search > .mp-search-shortcut:hover {
    background: var(--mp-menu-hover-bg, #f1f3f4);
}
body .mp-profile-settings-search > .mp-search-shortcut:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring, #007f6e);
    outline-offset: 2px;
}
body .mp-profile-settings-search > .mp-search-shortcut kbd {
    box-sizing: border-box;
    min-width: 18px;
    height: 20px;
    padding: 0 4px;
    border: 1px solid var(--mp-menu-header-divider, #d9e0e3);
    border-radius: 5px;
    background: var(--mp-profile-surface, #fff);
    color: var(--mp-menu-muted, #68757b);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}
@media (pointer: coarse) {
    body .mp-profile-settings-search > .mp-search-shortcut { display: none; }
}
.mp-profile-settings-search input {
    width: 100%; min-width: 0; border: 0; background: transparent;
    color: var(--mp-menu-text); font: inherit; font-size: 15px; outline: none;
}
.mp-profile-settings-search:focus-within { outline: 2px solid var(--mp-menu-focus-ring); outline-offset: 2px; }
.mp-profile-settings-sort {
    max-width: 150px; min-height: 38px; padding: 6px 10px;
    border: 1px solid var(--mp-menu-header-divider); border-radius: 999px;
    background: var(--mp-profile-surface); color: var(--mp-menu-text); font: inherit; font-size: 14px;
}
body .mp-profile-settings-modal .mp-profile-settings-section-title { padding-right: 0; }
@media (max-width: 640px) {
    body .mp-profile-settings-modal > .modal-dialog > .modal-content {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr) auto;
    }
    body .mp-profile-settings-modal > .modal-dialog > .modal-content > .modal-header { grid-column: 1; grid-row: 1; flex-wrap: wrap; }
    body .mp-profile-settings-modal .mp-profile-settings-nav { grid-column: 1; grid-row: 2; }
    body .mp-profile-settings-modal .mp-profile-settings-main { grid-column: 1; grid-row: 3; }
    body .mp-profile-settings-modal .modal-footer { grid-column: 1; grid-row: 4; }
    body .mp-profile-settings-modal .mp-profile-settings-nav-title { padding-right: 0; margin-bottom: 12px; }
    .mp-profile-settings-search { flex-basis: 100%; }
}

body #mp-playlists-modal .mp-library-sidebar-title,
body #mp-playlists-modal #mp-playlists-modal-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
body #mp-playlists-modal #mp-playlists-create-open {
    font-size: 14px;
}
#mp-playlists-modal #mp-playlists-create-submit:active:not(:disabled),
body #mp-playlists-modal #mp-playlists-create-open:active:not(:disabled),
body #mp-add-to-playlist-modal #mp-playlist-quick-submit:active:not(:disabled) {
    background-color: #005548;
    border-color: #005548;
    color: #fff;
    box-shadow: none;
}
#mp-playlists-modal:is([data-view="create"], [data-view="rename"]) :is(#mp-playlists-action-cancel, #mp-playlists-clear-name, #mp-playlists-back, .modal-header > .close):active:not(:disabled),
:is(#mp-playlists-modal, #mp-add-to-playlist-modal) .mp-playlists-feedback [data-playlists-retry]:active:not(:disabled) {
    background: var(--mp-menu-control-pressed-bg);
    color: var(--mp-btn-icon-text-active);
    box-shadow: none;
}
:is(#mp-playlists-modal, #mp-add-to-playlist-modal) .mp-playlists-feedback [data-playlists-retry]:active:not(:disabled) {
    border-color: transparent;
}
/* Selection is carried by the checkbox, not a second highlighted border. */
body #mp-add-to-playlist-modal .mp-playlist-option {
    border: 0;
}
body #mp-add-to-playlist-modal .mp-playlist-option:has(input:checked) {
    background: var(--mp-profile-subtle);
}
body #mp-add-to-playlist-modal .mp-playlist-option:hover:not(:active),
body #mp-add-to-playlist-modal #mp-playlist-quick-open:hover:not(:active) {
    background: var(--mp-menu-hover-bg);
}
body #mp-add-to-playlist-modal .mp-playlist-option:active,
body #mp-add-to-playlist-modal #mp-playlist-quick-open:active:not(:disabled) {
    background: var(--mp-menu-control-pressed-bg);
}
body #mp-add-to-playlist-modal .mp-playlist-option:has(input:focus-visible) {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: -2px;
}
body #mp-add-to-playlist-modal .mp-playlist-option input:focus-visible {
    outline: none;
}
@media (forced-colors: active) {
    body #mp-add-to-playlist-modal .mp-playlist-option:has(input:focus-visible) {
        outline-color: Highlight;
    }
}
/* Keep the quick-create field in step with the other modal forms. */
:root body #mp-add-to-playlist-modal #mp-playlist-quick-name {
    border: 1px solid var(--mp-menu-header-divider);
    background: var(--mp-profile-surface);
    color: var(--mp-menu-action-color);
    box-shadow: none;
}
:root #mp-add-to-playlist-modal #mp-playlist-quick-name:not(:disabled):is(:hover, :active, :focus) {
    border-color: var(--mp-profile-muted);
}
:root #mp-add-to-playlist-modal #mp-playlist-quick-name:focus {
    outline: 1px solid transparent;
    outline-offset: 2px;
    box-shadow: none;
}
:root #mp-add-to-playlist-modal #mp-playlist-quick-cancel {
    border: 1px solid var(--mp-menu-header-divider);
}
:root #mp-add-to-playlist-modal #mp-playlist-quick-cancel:hover:not(:active) {
    background: var(--mp-menu-hover-bg);
}
:root #mp-add-to-playlist-modal #mp-playlist-quick-cancel:active:not(:disabled) {
    background: var(--mp-menu-control-pressed-bg);
}
@media (forced-colors: active) {
    :root #mp-add-to-playlist-modal #mp-playlist-quick-name:focus-visible {
        outline-color: Highlight;
    }
}
body #mp-playlists-modal :is(#mp-playlists-search-input, #mp-bookmarks-search-input, #mp-recent-search-input, #mp-my-notes-search-input),
body #mp-playlists-modal :is(#mp-playlists-search-input, #mp-bookmarks-search-input, #mp-recent-search-input, #mp-my-notes-search-input)::placeholder {
    font-size: 15px;
}

/* Settings toolbar mirrors library search, sort and primary action geometry. */
body .mp-profile-settings-modal > .modal-dialog > .modal-content { grid-template-rows: auto minmax(0, 1fr); }
body .mp-profile-settings-modal .mp-profile-settings-nav { grid-row: 1 / -1; }
.mp-profile-settings-tabs { display: flex; flex-direction: column; gap: 4px; }
.mp-profile-settings-sidebar-help { margin: auto 8px 0; padding-top: 28px; color: var(--mp-profile-muted); font-size: 13px; line-height: 1.6; overflow-wrap: break-word; }
.mp-profile-settings-sidebar-help p { margin: 0; }
body #mp-playlists-modal .mp-library-sidebar-help,
body #mp-playlists-modal .mp-library-sidebar-help p {
    font-size: 13px;
    line-height: 1.6;
}
body .mp-profile-settings-modal .mp-profile-settings-search { height: 40px; box-sizing: border-box; padding: 0 12px; background: var(--mp-profile-subtle, #f5f7f8); }
body .mp-profile-settings-modal .mp-profile-settings-search input { padding: 2px 0 0; margin: 0; height: 100%; box-shadow: none; }
body .mp-profile-settings-modal .mp-profile-settings-search input::placeholder { color: var(--mp-menu-muted); opacity: 1; font: inherit; }
body .mp-profile-settings-modal .mp-profile-settings-search:focus-within { outline: 1px solid #64748b; outline-offset: 0; }
body .mp-profile-settings-modal .mp-profile-settings-sort { position: relative; flex-shrink: 0; padding: 0; border: 0; background: transparent; max-width: none; min-height: 36px; }
.mp-profile-settings-sort > summary { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 12px; box-sizing: border-box; border: 1px solid var(--mp-menu-header-divider); border-radius: 999px; color: var(--mp-menu-text); font-size: 14px; font-weight: 500; list-style: none; cursor: pointer; white-space: nowrap; }
.mp-profile-settings-sort > summary::after, .mp-profile-settings-sort > summary::-webkit-details-marker { display: none; }
.mp-profile-settings-sort > summary:hover { background: var(--mp-menu-hover-bg); }
.mp-profile-settings-sort-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; min-width: 180px; padding: 6px; border: 1px solid var(--mp-menu-header-divider); border-radius: 12px; background: var(--mp-profile-surface); }
.mp-profile-settings-sort-panel button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--mp-menu-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.mp-profile-settings-sort-panel button:is(:hover, :focus-visible) { background: var(--mp-menu-hover-bg); }
.mp-profile-settings-sort-panel button[aria-pressed="true"]::after { content: ''; width: 6px; height: 10px; margin-right: 4px; border: solid var(--mp-profile-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
body .mp-profile-settings-modal .modal-header > [data-profile-submit] { flex-shrink: 0; margin: 0; min-height: 36px; padding: 7px 16px; }
@media (max-width: 640px) {
    body .mp-profile-settings-modal > .modal-dialog > .modal-content { grid-template-rows: auto auto minmax(0, 1fr); }
    body .mp-profile-settings-modal .mp-profile-settings-nav { grid-row: 2; }
    .mp-profile-settings-sidebar-help { display: none; }
}

/* Interaction contract: hover is neutral, selection is green, removal is red.
   Primary submit buttons and filled active chips retain their own contrast. */
html body :is(
    .sort-dropdown-menu .sort-dropdown-item,
    #mp-display-panel .mp-display-option,
    .mp-media-actions-panel > a, .mp-media-actions-panel > button,
    .mp-notes-more-menu__item,
    #mp-playlists-modal .mp-playlist-menu-panel > a,
    #mp-playlists-modal .mp-playlist-menu-panel > button,
    #mp-playlists-modal .mp-library-section-actions > button,
    #mp-playlists-modal .mp-library-display-choices > button,
    .mp-notifications-panel .mp-notifications-actions-menu > button,
    .mp-notifications-item-actions-popup > button,
    #headerAppsMenu .header-apps-actions-popup > button,
    .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-breadcrumb):not(.navigation-profile-user) > a,
    .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-breadcrumb):not(.navigation-profile-user) > button,
    .navigation-profile .navigation-profile-menu .mp-profile-subview > a,
    .navigation-profile .navigation-profile-menu .mp-profile-subview > button,
    .mp-profile-settings-modal .mp-profile-settings-tab,
    .mp-profile-settings-modal .mp-profile-language-option,
    .mp-profile-settings-modal .mp-profile-settings-btn--cancel,
    .mp-profile-crop-modal .mp-profile-crop-action
):not(:disabled):not([aria-disabled="true"]):not(.is-disabled):not(.active):not(.is-active):not(.is-selected):not([aria-selected="true"]):not([aria-pressed="true"]):not([aria-current="page"]):not(.mp-playlist-menu-danger, .mp-notes-more-menu__item--danger):not(.mp-notifications-dismiss-all, .is-danger):not(.header-apps-restore-btn):not(.mp-bookmark-btn--menu.is-bookmarked):not([class*="remove"]):not([class*="clear"]):not([class*="delete"]):is(:hover, :focus-visible):not(:where(:active)) {
    background: var(--mp-menu-hover-bg) !important;
    color: var(--mp-menu-text) !important;
}
html body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li :is(a, button):is(:hover, :focus-visible) :is(svg, i, .mp-profile-menu-label) {
    color: inherit !important;
}
/* Action icons follow the label across home, details and the library.
   Selection checkmarks keep their own accent. */
html body :is(
    .mp-media-actions-panel,
    .sort-dropdown-menu,
    #mp-display-panel,
    #mp-playlists-modal .mp-playlist-menu-panel,
    #mp-playlists-modal .mp-library-section-actions,
    #mp-playlists-modal .mp-library-display-choices,
    .mp-details-notes .mp-notes-more-menu,
    .navigation-profile .navigation-profile-menu .mp-profile-subview
) :is(a, button) > :is(svg, i):not(.mp-playlist-menu-check) {
    color: var(--mp-menu-destructive-icon-color, inherit) !important;
}

/* Give the header actions the same high-contrast keyboard ring as the profile. */
.auth-language-wrapper :is(
    .mp-nav-notifications-header > .mp-header-control,
    .mp-nav-bookmarks-header > .mp-header-control,
    .mp-app-launcher-slot--header #headerAppsBtn,
    .navigation-profile.mp-header-control
):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: 2px;
    box-shadow: none !important;
}

/* Profile and guest triggers use a filled press state, without a press ring. */
html body .navigation-profile.mp-header-control.mp-header-menu:is(.active, :active:not(:has(> .navigation-profile-menu:active))),
html body .navigation-profile.mp-header-control:is(.active, :active:not(:has(> .navigation-profile-menu:active))) > .mp-profile-header-avatar {
    background: var(--mp-btn-icon-bg-active) !important;
    color: var(--mp-btn-icon-text-active) !important;
    box-shadow: none !important;
    transition: none;
}

html body #headerAppsBtn:not(:disabled):active {
    background: var(--mp-btn-icon-bg-active) !important;
    color: var(--mp-btn-icon-text-active) !important;
    box-shadow: none !important;
    transition: none;
}

/* Panel actions use a filled press with no pointer-focus ring.
   Overflow and close icons both use a neutral foreground. */
html body :is(
    #headerAppsMenu .header-apps-actions > summary,
    .mp-notifications-panel .mp-notifications-actions > summary,
    .mp-profile-settings-modal .mp-profile-window-menu > summary,
    #mp-playlists-modal .mp-library-section-menu > summary
):not(:disabled):not([aria-disabled="true"]):active {
    background: var(--mp-menu-control-pressed-bg) !important;
    color: var(--mp-btn-icon-text-active) !important;
    box-shadow: none !important;
    transition: none;
}

html body :is(
    #headerAppsMenu .header-apps-menu-close,
    .navigation-profile .navigation-profile-menu .navigation-profile-close,
    .mp-notifications-panel .mp-notifications-close,
    .mp-profile-settings-modal .mp-profile-close,
    .modal .modal-header .close,
    .mp-facets-close,
    .mp-details-mobile-dock__close,
    .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__close
):not(:disabled):not([aria-disabled="true"]):active {
    background: var(--mp-menu-control-pressed-bg) !important;
    border-color: transparent !important;
    color: var(--mp-menu-text) !important;
    box-shadow: none !important;
    transition: none;
}

/* Older dismiss buttons draw the X with pseudo-elements instead of SVG. */
html body :is(
    .navigation-profile .navigation-profile-menu .navigation-profile-close,
    .modal .modal-header .close,
    .mp-facets-close
):not(:disabled):not([aria-disabled="true"]):active::before,
html body :is(
    .navigation-profile .navigation-profile-menu .navigation-profile-close,
    .modal .modal-header .close,
    .mp-facets-close
):not(:disabled):not([aria-disabled="true"]):active::after {
    background-color: currentColor !important;
}

/* Legacy KIT styles also decorate :focus after a click. Keep only the keyboard ring. */
html body :is(
    #headerAppsMenu .header-apps-actions > summary,
    #headerAppsMenu .header-apps-menu-close,
    .navigation-profile .navigation-profile-menu .navigation-profile-close,
    .mp-notifications-panel .mp-notifications-actions > summary,
    .mp-notifications-panel .mp-notifications-close,
    .mp-profile-settings-modal .mp-profile-window-menu > summary,
    .mp-profile-settings-modal .mp-profile-close,
    #mp-playlists-modal .mp-library-section-menu > summary,
    .modal .modal-header .close,
    .mp-facets-close,
    .mp-details-mobile-dock__close,
    .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__close
):focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

html body :is(
    #headerAppsMenu .header-apps-actions > summary,
    #headerAppsMenu .header-apps-menu-close,
    .navigation-profile .navigation-profile-menu .navigation-profile-close,
    .mp-notifications-panel .mp-notifications-actions > summary,
    .mp-notifications-panel .mp-notifications-close,
    .mp-profile-settings-modal .mp-profile-window-menu > summary,
    .mp-profile-settings-modal .mp-profile-close,
    #mp-playlists-modal .mp-library-section-menu > summary,
    .modal .modal-header .close,
    .mp-facets-close,
    .mp-details-mobile-dock__close,
    .vjs-kit-fs-sidepanel .vjs-kit-fs-sidepanel__close
):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring) !important;
    outline-offset: -2px !important;
}

/* Sorting, profile and app launcher rows share the same press treatment. */
html body #headerAppsMenu .header-apps-actions-popup > button:not(:disabled):not([aria-disabled="true"]):active,
html body #headerAppsMenu .header-apps-tile:not(:has(.header-apps-fav-btn:active)):active,
html body #sort-dropdown-menu.mp-portal-sort-menu.sort-dropdown-menu .sort-dropdown-item:not(:disabled):not([aria-disabled="true"]):active,
html body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-profile-user) > :is(a, button):not(:disabled):not([aria-disabled="true"]):active,
html body .navigation-profile .navigation-profile-menu .mp-profile-subview :is(a, button):not(:disabled):not([aria-disabled="true"]):active {
    background: var(--mp-menu-control-pressed-bg) !important;
    box-shadow: none !important;
    transition: none;
}

html body #headerAppsMenu .header-apps-actions-popup > .header-apps-edit-btn:not(:disabled):not([aria-disabled="true"]):active,
html body #sort-dropdown-menu.mp-portal-sort-menu.sort-dropdown-menu .sort-dropdown-item:not(.active):not(:disabled):not([aria-disabled="true"]):active,
html body .navigation-profile .navigation-profile-menu ul:not(.side-widgets) > li:not(.navigation-profile-user) > :is(a, button):not(.is-active):not([aria-current="true"]):not(:disabled):not([aria-disabled="true"]):active,
html body .navigation-profile .navigation-profile-menu .mp-profile-subview :is(a, button):not(.is-active):not([aria-current="true"]):not(:disabled):not([aria-disabled="true"]):active {
    color: var(--mp-menu-text) !important;
}

/* Only the menu's saved bookmark is presented as a destructive action;
   standalone bookmark toggles keep their regular selected appearance. */
html body .mp-media-actions-panel > .mp-bookmark-btn--menu {
    user-select: none;
}
html body .mp-media-actions-panel > .mp-bookmark-btn--menu.is-bookmarked:not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible):not(:active) {
    background: var(--mp-menu-danger-hover-bg) !important;
    color: var(--mp-menu-danger-color) !important;
}

html body :is(
    .mp-media-actions-panel > .mp-bookmark-btn--menu.is-bookmarked,
    .mp-playlist-menu-danger, .mp-notes-more-menu__item--danger,
    .mp-notifications-dismiss-all, .mp-notifications-item-actions-popup > button.is-danger,
    .mp-my-notes-remove-item, .mp-my-notes-remove-item-single,
    .mp-bookmarks-remove-item, .mp-recent-remove-item,
    .mp-bookmarks-clear-all, .mp-recent-clear-all, .mp-my-notes-clear-all,
    .mp-bookmarks-clear-section, .mp-recent-clear-section, .mp-my-notes-clear-section,
    #headerAppsMenu .header-apps-restore-btn,
    .mp-profile-settings-modal :is(.mp-profile-settings-btn--reset, .mp-profile-settings-btn--remove),
    .mp-notes-toolbar-btn--danger, .mp-video-note-popup__delete
):not(:disabled):not([aria-disabled="true"]):not(.is-disabled, .disabled):active {
    --mp-menu-destructive-icon-color: currentColor;
    background: var(--mp-danger-pressed-bg) !important;
    color: var(--mp-danger-pressed-text) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
    user-select: none;
}
/* Compact login hierarchy; separators stay independent of link shapes. */
html body .login-panel {
    font-family: "Roboto", sans-serif;
}
html body .login-panel h1 {
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
}
html body .login-panel .login-panel-lead {
    margin-bottom: 26px !important;
    font-size: 15px;
    line-height: 1.6;
}
html body .login-panel .login-button {
    min-height: 44px;
    padding: 11px 20px;
    margin-bottom: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
}
html body .login-panel .login-button:not(.login-button-secondary):hover {
    background-color: #007d6c;
}
html body .login-panel .login-button:not(.login-button-secondary):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: 3px;
    box-shadow: none;
}
html body .login-panel .login-button:not(.login-button-secondary):active {
    background-color: #006557;
}
html body .login-panel .login-button-secondary:not(:disabled):active {
    background-color: var(--mp-btn-primary-bg-active);
}
html body .login-panel .login-panel-note {
    margin-bottom: 24px !important;
    font-size: 12px;
    line-height: 1.6;
}
html body .login-panel .login-panel-links {
    gap: 0;
    padding-top: 20px;
}
html body .login-panel .login-faq-block {
    width: 100%;
    gap: 0;
}
html body .login-panel .login-faq-question {
    margin-bottom: 8px !important;
    font-size: 12px;
    line-height: 1.5;
}
/* Login uses the same neutral secondary actions as portal menus. */
html body .login-panel :is(.login-about-link, .login-faq-link, .login-local-toggle, .login-back-to-ilias-link) {
    color: var(--mp-menu-text) !important;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html body .login-panel :is(.login-about-link, .login-faq-link, .login-local-toggle, .login-back-to-ilias-link):is(:hover, :focus-visible) {
    color: var(--mp-menu-text) !important;
    background: var(--mp-menu-hover-bg);
}
html body .login-panel :is(.login-about-link, .login-faq-link, .login-local-toggle, .login-back-to-ilias-link):focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring, #007f6e);
    outline-offset: 2px;
    box-shadow: none;
}
html body .login-panel :is(.login-about-link, .login-faq-link, .login-local-toggle, .login-back-to-ilias-link):active {
    background: var(--mp-btn-icon-bg-active);
    color: var(--mp-btn-icon-text-active) !important;
    box-shadow: none;
}
html body .login-panel :is(.login-panel-note, .login-faq-question, .login-local-hint) {
    color: var(--mp-menu-muted) !important;
    font-weight: 400;
}
html body .login-panel :is(.login-about-link, .login-faq-link) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    width: 100%;
    box-sizing: border-box;
    padding: 7px 8px;
    line-height: 1.4;
}
html body .login-panel .login-back-to-ilias-link {
    align-self: center;
    border: 0;
    margin-top: 14px;
    padding: 8px 12px;
    font-size: 13px;
    gap: 7px;
    color: var(--mp-menu-muted) !important;
}
html body .login-panel .login-ilias-return {
    width: 100%;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--mp-menu-header-divider);
}
html body .login-panel .login-ilias-return .login-back-to-ilias-link {
    display: flex;
    justify-content: center;
    min-height: 36px;
    box-sizing: border-box;
    margin-top: 0;
}
html body .login-panel .login-back-to-ilias-link:is(:hover, :focus-visible):not(:active) {
    color: var(--mp-menu-text) !important;
}
html body .login-panel .login-back-to-ilias-link i {
    top: 0;
    transform: none;
}
.login-button > svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
/* Hover and press highlight the filter row without changing its checkbox. */
html body #facets-containter .mp-facets-agg-list a {
    color: var(--mp-menu-text);
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    line-height: 1.4;
}
html body #facets-containter .mp-facets-agg-list a:is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg) !important;
    color: var(--mp-menu-text) !important;
}
/* Extend the group header's hit area like a filter value without shifting its text. */
html body #facets-containter summary.mp-facets-agg-header {
    box-sizing: border-box;
    width: calc(100% + 16px);
    margin-inline: -8px;
    padding-inline: 8px;
    border-radius: 8px;
}
html body #facets-containter summary.mp-facets-agg-header:focus:not(:focus-visible) {
    outline: none;
}
html body #facets-containter summary.mp-facets-agg-header:focus-visible {
    outline: 2px solid var(--mp-menu-focus-ring);
    outline-offset: -2px;
}
html body #facets-containter summary.mp-facets-agg-header:is(:hover, :focus-visible),
html body #facets-containter .mp-facets-more > :is(a, button):is(:hover, :focus-visible) {
    background: var(--mp-menu-hover-bg) !important;
    color: var(--mp-menu-text) !important;
}
html body #facets-containter :is(
    summary.mp-facets-agg-header,
    .mp-facets-agg-list a,
    .mp-facets-more > :is(a, button)
):not(:disabled):not([aria-disabled="true"]):active {
    background: var(--mp-menu-control-pressed-bg) !important;
    box-shadow: none !important;
}
/* Language selection must not share its selected border/color with plain hover. */
html body .mp-profile-settings-modal .mp-profile-language-option:not(.is-active):is(:hover, :focus-visible):not(:active) {
    border-color: var(--mp-menu-header-divider) !important;
}
html body .mp-profile-settings-modal .mp-profile-language-option:not(.is-active):not(:disabled):active {
    border-color: transparent !important;
    box-shadow: none !important;
}

@media (prefers-reduced-motion: no-preference) {
    html[data-bs-theme="dark"] body {
        transition: background-color 0.15s ease, color 0.15s ease;
    }
}
