:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f3ee;
    color: #202522;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 90% 0%, rgba(208, 63, 47, 0.1), transparent 34rem),
        #f5f3ee;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.eyebrow {
    margin: 0 0 0.7rem;
    color: #b0382d;
    font-size: 0.77rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.centered-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem 1rem;
}

.setup-card {
    width: min(760px, 100%);
    padding: clamp(1.5rem, 5vw, 3.5rem);
    border: 1px solid #ded9d0;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 24px 80px rgba(39, 42, 40, 0.08);
}

.setup-card h1 {
    max-width: 650px;
    margin: 0 0 1rem;
    font-size: clamp(2.5rem, 8vw, 5.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.setup-card .lead {
    max-width: 650px;
    margin: 0 0 2.5rem;
    color: #626964;
    font-size: 1.08rem;
    line-height: 1.65;
}

.setup-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid #e3dfd8;
}

.step-number {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    background: #202522;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
}

.setup-step h2 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
}

.setup-step p,
.setup-step ul {
    margin: 0.35rem 0 0;
    color: #656c67;
    line-height: 1.55;
}

.setup-step code {
    overflow-wrap: anywhere;
}

code {
    padding: 0.14rem 0.35rem;
    border-radius: 0.35rem;
    background: #efebe4;
    color: #6f2822;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
}

.privacy-note {
    margin: 1.5rem 0 0;
    color: #727873;
    font-size: 0.86rem;
    line-height: 1.55;
}

.offline-icon {
    display: block;
    width: 7rem;
    height: 7rem;
    margin: 0 auto 1.25rem;
    border-radius: 1.5rem;
}

.offline-notice {
    position: fixed;
    z-index: 40;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: fit-content;
    max-width: min(36rem, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0.8rem 1rem;
    border: 1px solid #e2c36a;
    border-radius: 0.75rem;
    background: #fff4d9;
    box-shadow: 0 12px 36px rgba(39, 42, 40, 0.14);
    color: #624d13;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

.offline-notice[hidden] {
    display: none;
}

.login-card {
    max-width: 670px;
    text-align: center;
}

.login-card .lead {
    margin-right: auto;
    margin-left: auto;
}

.app-summary {
    max-width: 570px;
    margin: -1.4rem auto 2rem;
    color: #626964;
    line-height: 1.6;
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.2rem;
    color: #626964;
    font-size: 0.85rem;
}

.legal-card h1 {
    font-size: clamp(2.2rem, 7vw, 4.2rem);
}

.legal-section {
    padding: 1.15rem 0;
    border-top: 1px solid #e3dfd8;
}

.legal-section h2 {
    margin: 0 0 0.55rem;
    font-size: 1.05rem;
}

.legal-section p,
.legal-section ul {
    margin: 0.45rem 0 0;
    color: #626964;
    line-height: 1.65;
}

.legal-back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: #6f2822;
    font-weight: 750;
}

.primary-button {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.15rem;
    border: 0;
    border-radius: 0.75rem;
    background: #c63d30;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(198, 61, 48, 0.2);
}

.primary-button:hover {
    background: #a92f25;
}

.primary-button:focus-visible,
.text-button:focus-visible,
.mobile-manage-button:focus-visible,
.mobile-action-sheet-close:focus-visible,
.mobile-move-destination-select:focus-visible,
.mobile-move-button:focus-visible,
.mobile-delete-button:focus-visible,
.reset-button:focus-visible,
.search-clear:focus-visible,
.piano-filters-disclosure summary:focus-visible,
.piano-recent-search-button:focus-visible,
.move-button:focus-visible,
.move-destination-select:focus-visible,
.delete-button:focus-visible,
.undo-delete-button:focus-visible,
.bulk-select-button:focus-visible,
.bulk-clear-button:focus-visible,
.bulk-move-button:focus-visible,
.bulk-move-destination:focus-visible,
.bulk-delete-button:focus-visible,
.preview-button:focus-visible,
.preview-seek button:focus-visible,
.playlist-link:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(31, 106, 78, 0.35);
    outline-offset: 3px;
}

.secondary-link {
    display: block;
    margin-top: 1rem;
    color: #5e6661;
}

.app-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    width: 100%;
    min-height: 4.2rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem max(1rem, calc((100vw - 1480px) / 2));
    border-bottom: 1px solid rgba(210, 205, 196, 0.85);
    background: rgba(245, 243, 238, 0.9);
    backdrop-filter: blur(16px);
}

.brand {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.045em;
    text-decoration: none;
}

.brand span {
    color: #c63d30;
}

.account-menu {
    position: relative;
    color: #6a716c;
    font-size: 0.82rem;
}

.account-menu-trigger {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #d7d2c9;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-weight: 750;
    list-style: none;
}

.account-menu-trigger::-webkit-details-marker {
    display: none;
}

.account-menu-trigger:focus-visible {
    outline: 3px solid rgba(31, 106, 78, 0.25);
    outline-offset: 2px;
}

.account-menu-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.account-menu-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.55rem);
    right: 0;
    display: grid;
    width: min(19rem, calc(100vw - 2rem));
    gap: 0.45rem;
    padding: 0.8rem;
    border: 1px solid #d7d2c9;
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 18px 50px rgba(40, 44, 41, 0.16);
}

.account-menu-panel p {
    overflow-wrap: anywhere;
    margin: 0 0 0.35rem;
    color: #6a716c;
    line-height: 1.45;
}

.account-menu-panel form {
    margin: 0;
}

.account-menu-action {
    width: 100%;
    padding: 0.65rem 0.7rem;
    border: 1px solid #d7d2c9;
    border-radius: 0.55rem;
    background: #f5f3ee;
    color: #354039;
    cursor: pointer;
    font-weight: 750;
    text-align: left;
}

.account-menu-action:hover,
.account-menu-action:focus-visible {
    border-color: #9daba3;
    background: #eeece6;
}

.account-menu-action.is-danger {
    color: #8b332b;
}

.account-menu-legal {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    margin-top: 0.25rem;
    padding: 0.65rem 0.25rem 0.1rem;
    border-top: 1px solid #e3dfd8;
    font-size: 0.76rem;
}

.login-notice {
    margin: 0 0 1.2rem;
    padding: 0.8rem 1rem;
    border: 1px solid #bad8c8;
    border-radius: 0.75rem;
    background: #e8f4ed;
    color: #24573f;
    line-height: 1.5;
}

.login-notice.is-warning {
    border-color: #e5c98d;
    background: #fff4d9;
    color: #75551d;
}

.catalog-shell {
    width: min(1480px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3.5rem) 0 4rem;
}

.catalog-layout {
    display: grid;
    grid-template-columns: minmax(200px, 250px) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 3rem);
}

.catalog-workspace {
    display: grid;
    grid-template-columns: minmax(480px, 1fr) minmax(360px, 430px);
    gap: clamp(1.25rem, 2vw, 2rem);
    min-width: 0;
}

.watch-action-notices {
    grid-column: 1 / -1;
}

.watch-action-notices:empty {
    display: none;
}

.watch-action-notices .move-notice {
    width: 100%;
}

.move-notice {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid;
    border-radius: 0.75rem;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.45;
}

.move-notice.is-success {
    border-color: #a8cbb9;
    background: #e9f5ee;
    color: #23533e;
}

.move-notice.is-warning {
    border-color: #dcc38d;
    background: #fbf3df;
    color: #6f5319;
}

.move-notice.is-error {
    border-color: #e0aaa2;
    background: #f8e4df;
    color: #7d2d25;
}

.action-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.undo-delete-form,
.undo-move-form,
.delete-video-form {
    margin: 0;
}

.undo-delete-button {
    padding: 0.35rem 0.6rem;
    border: 1px solid currentColor;
    border-radius: 0.45rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
    white-space: nowrap;
}

.undo-delete-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.catalog-content {
    min-width: 0;
}

.catalog-tools {
    position: relative;
}

.bulk-actions {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem;
    margin: -0.5rem 0 1.2rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.8rem;
    background: #202522;
    color: #fff;
    box-shadow: 0 10px 30px rgba(32, 37, 34, 0.16);
}

.bulk-selection-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    font-size: 0.76rem;
}

.bulk-operation-controls {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.bulk-move-destination {
    width: min(11rem, 100%);
    min-height: 2.2rem;
    padding: 0.35rem 1.8rem 0.35rem 0.5rem;
    border: 1px solid #69716c;
    border-radius: 0.5rem;
    background: #fff;
    color: #303632;
    font-size: 0.74rem;
}

.bulk-select-button,
.bulk-clear-button,
.bulk-move-button,
.bulk-delete-button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 850;
}

.bulk-select-button {
    padding: 0;
    color: #d9e9e1;
}

.bulk-clear-button {
    padding: 0;
    color: #d7d3cb;
}

.bulk-move-button,
.bulk-delete-button {
    min-height: 2.2rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    white-space: nowrap;
}

.bulk-move-button {
    background: #2f7559;
}

.bulk-delete-button {
    background: #c63d30;
}

.bulk-select-button:disabled,
.bulk-clear-button:disabled,
.bulk-move-button:disabled,
.bulk-delete-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.bulk-limit {
    flex-basis: 100%;
    margin: 0;
    color: #f0c7c2;
    font-size: 0.72rem;
}

.playlist-sidebar {
    position: sticky;
    top: 5.7rem;
    overflow-y: auto;
    max-height: calc(100vh - 7rem);
    align-self: start;
    padding: 1rem;
    border: 1px solid #ded9d0;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.68);
}

.playlist-sidebar .eyebrow {
    margin: 0 0 0.55rem 0.65rem;
}

.playlist-list {
    display: grid;
    gap: 0.05rem;
}

.playlist-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.65rem;
    color: #555d58;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.playlist-link > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-link small {
    color: #858b87;
    font-size: 0.72rem;
}

.playlist-link:hover {
    background: #efebe4;
    color: #202522;
}

.playlist-link.is-selected {
    background: #202522;
    color: #fff;
}

.playlist-link.is-selected small {
    color: #d9ddd9;
}

.playlist-link.is-in-progress:not(.is-selected) {
    background: #e7f2ec;
    color: #1f6048;
}

.playlist-link.is-in-progress:not(.is-selected) small {
    color: #39745d;
}

.playlist-link.is-piano:not(.is-selected) {
    background: #efebfa;
    color: #594394;
}

.playlist-link.is-piano:not(.is-selected) small {
    color: #735eac;
}

.playlist-switcher {
    display: none;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
}

.playlist-switcher > span {
    color: #656d68;
    font-size: 0.78rem;
    font-weight: 800;
}

.playlist-switcher select {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid #cfc9c0;
    border-radius: 0.75rem;
    background: #fff;
    color: #202522;
    font-weight: 750;
}

.catalog-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.2rem;
}

.catalog-intro h1 {
    max-width: 880px;
    margin: 0 0 0.6rem;
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.catalog-intro p:last-child {
    margin: 0;
    color: #68706b;
}

.is-in-progress-view .catalog-intro {
    padding: 1.25rem;
    border: 1px solid #a8cbb9;
    border-radius: 1rem;
    background: linear-gradient(135deg, #e9f5ee 0%, rgba(255, 255, 255, 0.7) 100%);
}

.is-in-progress-view .catalog-intro h1 {
    color: #23533e;
}

.is-piano-view .catalog-intro {
    padding: 1.25rem;
    border: 1px solid #c9bee9;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f0ecfb 0%, rgba(255, 255, 255, 0.72) 100%);
}

.is-piano-view .catalog-intro h1 {
    color: #51398f;
}

.is-piano-view .catalog-intro .eyebrow {
    color: #6651a7;
}

.in-progress-intro-copy,
.piano-intro-copy {
    max-width: 46rem;
    line-height: 1.5;
}

.special-shortcuts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.special-shortcut,
.in-progress-shortcut {
    display: grid;
    width: 12rem;
    gap: 0.12rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid #a8cbb9;
    border-radius: 0.7rem;
    background: #e9f5ee;
    color: #23533e;
    text-decoration: none;
}

.special-shortcut span,
.special-shortcut small,
.in-progress-shortcut span,
.in-progress-shortcut small {
    font-size: 0.7rem;
}

.special-shortcut span,
.in-progress-shortcut span {
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.special-shortcut strong,
.in-progress-shortcut strong {
    font-size: 0.85rem;
}

.piano-shortcut {
    border-color: #c9bee9;
    background: #f0ecfb;
    color: #51398f;
}

.filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #ded9d0;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.68);
}

.search-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.piano-recent-searches {
    display: flex;
    min-width: 0;
    gap: 0.45rem;
    margin: 0 0 0.65rem;
    overflow-x: auto;
    padding: 0.65rem;
    border: 1px solid #d9d1ed;
    border-radius: 0.85rem;
    background: #faf8ff;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.piano-recent-searches[hidden],
.piano-recent-search-button[hidden] {
    display: none;
}

.piano-recent-search-button {
    flex: 0 1 auto;
    min-width: 4.5rem;
    max-width: 12rem;
    min-height: 2.3rem;
    overflow: hidden;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cfc7e5;
    border-radius: 999px;
    background: #f0ecfb;
    color: #51398f;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.piano-recent-search-button:hover {
    border-color: #8a73c7;
    background: #e8e0fa;
}

.piano-filters-disclosure {
    margin: 0 0 1.5rem;
    border: 1px solid #ded9d0;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.68);
}

.piano-filters-disclosure > summary {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    color: #555d58;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 800;
    list-style: none;
}

.piano-filters-disclosure > summary::-webkit-details-marker {
    display: none;
}

.piano-filters-disclosure > summary svg {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 160ms ease;
}

.piano-filters-disclosure[open] > summary svg {
    transform: rotate(180deg);
}

.piano-filters-disclosure .filters {
    margin: 0;
    border: 0;
    border-top: 1px solid #e6e1d9;
    border-radius: 0 0 0.85rem 0.85rem;
    background: transparent;
}

.search-field {
    display: grid;
    min-width: 0;
    gap: 0.4rem;
}

.filters label {
    display: grid;
    gap: 0.4rem;
}

.filters label > span,
.search-field > label {
    color: #656d68;
    font-size: 0.76rem;
    font-weight: 750;
}

.search-input-control {
    position: relative;
}

.filters input,
.filters select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid #d4cfc6;
    border-radius: 0.65rem;
    background: #fff;
    color: #202522;
}

.search-input-control input {
    padding-right: 2.75rem;
}

.search-input-control input::-webkit-search-cancel-button {
    display: none;
    -webkit-appearance: none;
    appearance: none;
}

.search-clear {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    color: #4e5551;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.search-clear:hover {
    color: #202522;
}

.filters .density-control {
    display: none;
}

.density-control-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.5rem;
    align-items: center;
    gap: 0.7rem;
}

.filters .density-range {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: #c63d30;
    cursor: pointer;
}

.density-control output {
    display: grid;
    min-height: 2.35rem;
    place-items: center;
    border: 1px solid #d4cfc6;
    border-radius: 0.55rem;
    background: #fff;
    color: #202522;
    font-weight: 850;
}

.density-control small {
    color: #737a75;
    font-size: 0.7rem;
}

.reset-button {
    min-height: 2.75rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid #cbc6bd;
    border-radius: 0.65rem;
    background: transparent;
    color: #555d58;
    cursor: pointer;
    font-weight: 700;
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

.operation-progress[hidden] {
    display: none;
}

.operation-progress {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(32, 37, 34, 0.32);
    backdrop-filter: blur(3px);
}

.operation-progress-card {
    display: flex;
    max-width: min(24rem, 100%);
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.15rem;
    border: 1px solid #d7d2c9;
    border-radius: 0.85rem;
    background: #fff;
    color: #202522;
    box-shadow: 0 18px 55px rgba(32, 37, 34, 0.2);
    font-size: 0.9rem;
    font-weight: 800;
}

.operation-spinner {
    flex: 0 0 auto;
    width: 1.4rem;
    height: 1.4rem;
    border: 3px solid #e3ded5;
    border-top-color: #c63d30;
    border-radius: 50%;
    animation: operation-spin 700ms linear infinite;
}

body.is-operation-pending {
    overflow: hidden;
}

@keyframes operation-spin {
    to {
        transform: rotate(1turn);
    }
}

@media (prefers-reduced-motion: reduce) {
    .operation-spinner {
        animation-duration: 1.5s;
    }

    .piano-filters-disclosure > summary svg {
        transition-duration: 0s;
    }
}

.video-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #ded9d0;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 40px rgba(40, 44, 41, 0.04);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mobile-manage-button {
    display: none;
}

.mobile-action-sheet:not([open]) {
    display: none;
}

.mobile-action-sheet {
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    overflow: visible;
    width: min(36rem, 100%);
    max-width: none;
    max-height: min(82vh, 48rem);
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 1.2rem 1.2rem 0 0;
    background: transparent;
    color: #202522;
}

.mobile-action-sheet::backdrop {
    background: rgba(32, 37, 34, 0.42);
    backdrop-filter: blur(2px);
}

.mobile-action-sheet-panel {
    overflow-y: auto;
    max-height: min(82vh, 48rem);
    padding: 1.2rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
    border-radius: 1.2rem 1.2rem 0 0;
    background: #fdfcf9;
    box-shadow: 0 -18px 55px rgba(32, 37, 34, 0.2);
}

.mobile-action-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.mobile-action-sheet-header .eyebrow {
    margin-bottom: 0.3rem;
}

.mobile-action-sheet-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.mobile-action-sheet-close {
    display: grid;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    padding: 0;
    border: 1px solid #d7d2c9;
    border-radius: 50%;
    background: #fff;
    color: #555d58;
    cursor: pointer;
    font-size: 1.5rem;
}

.mobile-action-sheet-title {
    margin: 1rem 0;
    color: #555d58;
    font-weight: 750;
    line-height: 1.4;
}

.mobile-move-video-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    margin: 0;
}

.mobile-move-video-form label {
    grid-column: 1 / -1;
    color: #656d68;
    font-size: 0.76rem;
    font-weight: 800;
}

.mobile-move-destination-select,
.mobile-move-button,
.mobile-delete-button {
    min-height: 3rem;
    border-radius: 0.7rem;
    font-weight: 800;
}

.mobile-move-destination-select {
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border: 1px solid #cbc6bd;
    background: #fff;
    color: #202522;
}

.mobile-move-button {
    padding: 0.65rem 1rem;
    border: 0;
    background: #1f6a4e;
    color: #fff;
    cursor: pointer;
}

.mobile-move-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.mobile-delete-video-form {
    margin: 0.8rem 0 0;
}

.mobile-delete-button {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #dca79f;
    background: #fff;
    color: #a73329;
    cursor: pointer;
}

.mobile-action-sheet-note {
    margin: 0.8rem 0 0;
    color: #737a75;
    font-size: 0.72rem;
    line-height: 1.45;
}

body.is-action-sheet-open {
    overflow: hidden;
}

.video-card[hidden] {
    display: none;
}

.video-media {
    position: relative;
    min-width: 0;
}

.thumbnail-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #dedad2;
}

.thumbnail-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.thumbnail-link:hover img {
    transform: scale(1.025);
}

.thumbnail-placeholder {
    display: grid;
    height: 100%;
    place-items: center;
    color: #747b76;
    font-size: 0.85rem;
}

.duration-badge {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    padding: 0.24rem 0.42rem;
    border-radius: 0.3rem;
    background: rgba(18, 20, 19, 0.88);
    color: #fff;
    font-size: 0.73rem;
    font-weight: 800;
}

.video-body {
    padding: 1rem;
}

.video-selector {
    display: none;
    width: fit-content;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.55rem;
    color: #59615c;
    cursor: pointer;
    font-size: 0.73rem;
    font-weight: 800;
}

.video-selector input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: #1f6a4e;
}

.video-channel {
    overflow: hidden;
    margin: 0 0 0.42rem;
    color: #737a75;
    font-size: 0.78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-card h2 {
    display: -webkit-box;
    overflow: hidden;
    min-height: 3.1rem;
    margin: 0 0 1.2rem;
    font-size: 1.05rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.video-card h2 a {
    text-decoration: none;
}

.video-card h2 a:hover {
    text-decoration: underline;
    text-decoration-color: #c63d30;
    text-underline-offset: 0.2em;
}

.piano-piece-title {
    margin: 0;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #d9d1ed;
    background: #f6f2ff;
    color: #51398f;
    line-height: 1.35;
}

.piano-piece-title strong {
    display: block;
    font-size: 0.9rem;
}

.piano-piece-title.is-fallback {
    border-bottom-color: #dedbe0;
    background: #f3f1f4;
    color: #77707f;
}

.watch-video-link[aria-disabled="true"] {
    cursor: wait;
    opacity: 0.65;
}

.video-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    color: #747b76;
    font-size: 0.73rem;
}

.video-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.move-video-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.move-destination-select {
    width: min(12rem, 100%);
    min-height: 2rem;
    padding: 0.3rem 1.8rem 0.3rem 0.45rem;
    border: 1px solid #cbc6bd;
    border-radius: 0.45rem;
    background: #fff;
    color: #3f4742;
    font-size: 0.73rem;
}

.move-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1f6a4e;
    cursor: pointer;
    font-size: 0.73rem;
    font-weight: 850;
}

.move-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.move-video-form.is-submitting .move-button:disabled {
    cursor: wait;
}

.delete-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #a73329;
    cursor: pointer;
    font-size: 0.73rem;
    font-weight: 850;
}

.delete-button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.preview-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1f6a4e;
    cursor: pointer;
    font-size: 0.73rem;
    font-weight: 850;
}

.preview-button[aria-pressed="true"] {
    color: #202522;
}

.watch-link {
    color: #a73329;
    font-weight: 800;
    text-decoration: none;
}

.preview-pane {
    position: sticky;
    top: 5.7rem;
    overflow-y: auto;
    max-height: calc(100vh - 7rem);
    align-self: start;
    padding: 1rem;
    border: 1px solid #d7d2c9;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 55px rgba(40, 44, 41, 0.07);
}

.preview-frame {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 0.75rem;
    background: #171918;
}

#preview-player,
.preview-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

#preview-player {
    display: grid;
    place-items: center;
    padding: 1rem;
    color: #d9ddd9;
    font-size: 0.86rem;
    text-align: center;
}

.preview-error {
    margin: 0.75rem 0 0;
    padding: 0.7rem 0.8rem;
    border-radius: 0.6rem;
    background: #f8e4df;
    color: #7d2d25;
    font-size: 0.8rem;
    line-height: 1.45;
}

.preview-error[hidden] {
    display: none;
}

.preview-seek {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0.8rem 0 1.2rem;
}

.preview-seek button {
    min-height: 2.5rem;
    border: 1px solid #cbc6bd;
    border-radius: 0.55rem;
    background: #f7f5f1;
    color: #3f4742;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
}

.preview-seek button:hover:not(:disabled) {
    border-color: #1f6a4e;
    color: #1f6a4e;
}

.preview-seek button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.preview-channel {
    margin: 0 0 0.35rem;
    color: #727974;
    font-size: 0.78rem;
    font-weight: 750;
}

.preview-details h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
    letter-spacing: -0.025em;
}

.preview-description {
    overflow-y: auto;
    max-height: 15rem;
    margin: 1rem 0 1.2rem;
    padding-right: 0.4rem;
    color: #5f6762;
    font-size: 0.88rem;
    line-height: 1.58;
    white-space: pre-line;
}

.preview-youtube-link {
    width: 100%;
}

.preview-youtube-link[hidden] {
    display: none;
}

@media (min-width: 1181px) and (pointer: fine) {
    .catalog-tools {
        position: sticky;
        z-index: 5;
        top: 5rem;
        padding-top: 0.1rem;
        background: #f5f3ee;
    }

    .video-card.is-previewed {
        border-color: #77877f;
        box-shadow: 0 0 0 2px rgba(31, 106, 78, 0.12), 0 12px 40px rgba(40, 44, 41, 0.05);
    }

    .video-card.is-selected {
        border-color: #1f6a4e;
        box-shadow: 0 0 0 2px rgba(31, 106, 78, 0.18), 0 12px 40px rgba(40, 44, 41, 0.05);
    }

    .bulk-actions {
        display: flex;
    }

    .video-selector {
        display: inline-flex;
    }

    .video-card {
        display: grid;
        grid-template-columns: minmax(170px, 34%) minmax(0, 1fr);
    }

    .piano-piece-title {
        grid-column: 1 / -1;
    }

    .video-media .thumbnail-link {
        height: 100%;
        min-height: 145px;
        aspect-ratio: auto;
    }

    .video-body {
        display: flex;
        min-width: 0;
        flex-direction: column;
    }

    .video-card h2 {
        margin-bottom: 0.8rem;
    }

    .video-footer {
        align-items: flex-start;
        flex-direction: column;
        margin-top: auto;
    }
}

.empty-state {
    padding: 5rem 1rem;
    text-align: center;
}

.empty-state[hidden] {
    display: none;
}

.empty-state h2 {
    margin-bottom: 0.45rem;
}

.empty-state p {
    margin: 0;
    color: #717873;
}

@media (max-width: 1180px), (pointer: coarse) {
    .app-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.7rem;
        padding: 0.65rem 1rem;
    }

    .header-playlist-switcher {
        display: block;
        min-width: 0;
        margin: 0;
    }

    .header-playlist-switcher > span {
        position: absolute;
        overflow: hidden;
        width: 1px;
        height: 1px;
        padding: 0;
        border: 0;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .header-playlist-switcher select {
        min-height: 2.75rem;
        padding: 0.5rem 0.65rem;
        text-overflow: ellipsis;
    }

    .account-menu-label {
        display: none;
    }

    .account-menu-trigger {
        width: 2.75rem;
        height: 2.75rem;
        justify-content: center;
        padding: 0;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .playlist-sidebar {
        display: none;
    }

    .playlist-switcher {
        display: block;
    }

    .catalog-workspace {
        display: block;
    }

    .preview-pane,
    .preview-button,
    .move-video-form,
    .delete-video-form {
        display: none;
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .video-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) max-content;
        align-items: start;
        column-gap: 0.65rem;
    }

    .video-channel {
        grid-column: 1;
        grid-row: 1;
    }

    .video-card h2 {
        grid-column: 1;
        grid-row: 2;
    }

    .video-footer,
    .video-actions {
        display: contents;
    }

    .video-footer > span {
        grid-column: 1;
        grid-row: 3;
    }

    .filters .density-control {
        display: grid;
        grid-column: 1 / -1;
    }

    .video-grid {
        grid-template-columns: repeat(var(--video-columns, 2), minmax(0, 1fr));
        gap: clamp(0.5rem, 1.5vw, 1rem);
    }

    .video-grid:is([data-columns="5"], [data-columns="6"]) .video-card h2 {
        min-height: 3.32rem;
        margin-bottom: 0.85rem;
        font-size: 0.85rem;
        line-height: 1.3;
        -webkit-line-clamp: 3;
    }

    .video-grid:is([data-columns="5"], [data-columns="6"]) .video-body {
        padding: 0.7rem;
    }

    .video-grid:is([data-columns="5"], [data-columns="6"]) .piano-piece-title {
        padding: 0.5rem 0.7rem;
    }

    .video-grid:is([data-columns="5"], [data-columns="6"]) .piano-piece-title strong {
        font-size: 0.78rem;
    }

    .video-grid:is([data-columns="7"], [data-columns="8"]) .video-card h2 {
        min-height: 3.6rem;
        margin-bottom: 0.7rem;
        font-size: 0.72rem;
        line-height: 1.25;
        -webkit-line-clamp: 4;
    }

    .video-grid:is([data-columns="7"], [data-columns="8"]) .video-body {
        padding: 0.5rem;
    }

    .video-grid:is([data-columns="7"], [data-columns="8"]) .piano-piece-title {
        padding: 0.42rem 0.5rem;
    }

    .video-grid:is([data-columns="7"], [data-columns="8"]) .piano-piece-title strong {
        font-size: 0.68rem;
    }

    .mobile-manage-button {
        position: absolute;
        z-index: 2;
        top: 0;
        right: 0;
        display: grid;
        width: 2.75rem;
        height: 2.75rem;
        place-items: center;
        padding: 0;
        border: 0;
        background: transparent;
        color: #202522;
        cursor: pointer;
        font-size: 1.05rem;
        font-weight: 900;
        line-height: 1;
    }

    .mobile-manage-button > span {
        display: grid;
        width: 2.0625rem;
        height: 2.0625rem;
        place-items: center;
        border: 1px solid rgba(32, 37, 34, 0.15);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 4px 14px rgba(32, 37, 34, 0.14);
    }

    .thumbnail-link {
        pointer-events: none;
    }

    .video-title-link {
        cursor: default;
        pointer-events: none;
    }

    .video-card h2 .video-title-link:hover {
        text-decoration: none;
    }

    .watch-link {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
        max-width: 8.5rem;
        min-height: 2.9rem;
        align-items: center;
        align-self: start;
        justify-content: center;
        padding: 0.65rem 0.9rem;
        border-radius: 0.65rem;
        background: #c63d30;
        color: #fff;
        line-height: 1.2;
        text-align: center;
    }

    .watch-link:hover {
        background: #a92f25;
    }

    .is-in-progress-view .watch-link {
        background: #1f6a4e;
    }

    .is-in-progress-view .watch-link:hover {
        background: #174e3a;
    }

    .is-piano-view .watch-link {
        background: #6651a7;
    }

    .is-piano-view .watch-link:hover {
        background: #51398f;
    }
}

@media (max-width: 700px) {
    .catalog-intro {
        align-items: stretch;
        flex-direction: column;
    }

    .special-shortcuts {
        justify-content: stretch;
    }

    .special-shortcut,
    .in-progress-shortcut {
        width: auto;
        flex: 1 1 10rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: repeat(var(--video-columns, 1), minmax(0, 1fr));
    }

    .video-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .action-notice {
        align-items: flex-start;
        flex-direction: column;
    }

    .setup-step {
        grid-template-columns: 1fr;
    }
}
