@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes tableLoadingWave {
    0% {
        transform: translateX(-120%) scaleX(1);
    }

    40% {
        transform: translateX(40%) scaleX(1.25);
    }

    55% {
        transform: translateX(80%) scaleX(0.85);
    }

    100% {
        transform: translateX(260%) scaleX(1);
    }
}

@keyframes dotIdle {
    0%, 100% {
        box-shadow: 0 0 0 5px var(--ink-faint);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 0 8px var(--ink-faint);
        opacity: 0.82;
    }
}

@keyframes dotPlaying {
    0%, 100% {
        box-shadow: 0 0 0 5px rgba(38, 112, 77, 0.16);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(38, 112, 77, 0.08), 0 0 0 5px rgba(38, 112, 77, 0.2);
    }
}

@keyframes dotOffline {
    0%, 100% {
        box-shadow: 0 0 0 5px rgba(164, 43, 35, 0.15);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 0 5px rgba(164, 43, 35, 0.04);
        opacity: 0.42;
    }
}

@keyframes controlRoomAir {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.04);
    }
}

@keyframes cardEntrance {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bodyGlow {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

@keyframes eqBar {
    0%, 100% { transform: scaleY(0.45); opacity: 0.4; }
    50% { transform: scaleY(1); opacity: 1; }
}

@keyframes nowPlayingSpark {
    0% { text-shadow: 0 0 0 transparent; }
    35% { text-shadow: 0 0 10px var(--accent-soft), 0 0 3px var(--accent-soft); }
    100% { text-shadow: 0 0 0 transparent; }
}

@keyframes rowReveal {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sentRing {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-3px); }
    30% { transform: translateX(3px); }
    50% { transform: translateX(-2px); }
    65% { transform: translateX(2px); }
    80% { transform: translateX(-1px); }
}

@keyframes navGlint {
    0%, 100% { background-position: 200% 0; }
    25%, 75% { background-position: 200% 0; }
    50% { background-position: -100% 0; }
}

@keyframes ambientScan {
    0% { transform: translateY(0); }
    100% { transform: translateY(50%); }
}

@keyframes dialogEnter {
    from {
        opacity: 0;
        transform: translate3d(0, 6px, 0) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes backdropEnter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes buttonFlash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes doodleWobble {
    0% { transform: translate(-2px, -2px) rotate(-2deg) scale(1.03); }
    25% { transform: translate(-3px, -1px) rotate(-3deg) scale(1.04); }
    50% { transform: translate(-1px, -3px) rotate(-1deg) scale(1.03); }
    75% { transform: translate(-2px, -2px) rotate(-2.5deg) scale(1.035); }
    100% { transform: translate(-2px, -2px) rotate(-2deg) scale(1.03); }
}

@keyframes doodlePress {
    0% { transform: translate(2px, 2px) scale(0.92); }
    50% { transform: translate(3px, 1px) scale(0.9) rotate(1deg); }
    100% { transform: translate(2px, 2px) scale(0.92); }
}

@keyframes doodleEntrance {
    0% {
        opacity: 0;
        transform: translateY(8px) rotate(-3deg) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateY(-2px) rotate(1deg) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
    }
}

@keyframes queueEnter {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@supports not (color: oklch(50% 0.1 50)) {
    :root {
        --button-cartoon-shadow: 5px 6px 0 rgba(23, 18, 13, 0.22);
        --button-cartoon-shadow-hover: 8px 9px 0 rgba(23, 18, 13, 0.26);
        --button-cartoon-shadow-active: 2px 3px 0 rgba(23, 18, 13, 0.24);
        --button-cartoon-highlight: inset 0 3px 0 rgba(255, 252, 247, 0.5);
    }

    html.theme-dark {
        --button-cartoon-shadow: 5px 6px 0 rgba(5, 7, 6, 0.48);
        --button-cartoon-shadow-hover: 8px 9px 0 rgba(5, 7, 6, 0.52);
        --button-cartoon-shadow-active: 2px 3px 0 rgba(5, 7, 6, 0.52);
        --button-cartoon-highlight: inset 0 3px 0 rgba(244, 240, 232, 0.16);
    }

    .theme-toggle,
    .play-button,
    .play-btn,
    .web-control-button,
    .web-upload-control-button,
    .control-room-actions-trigger,
    .web-upload-file-button,
    .web-upload-submit {
        border: 3px solid rgb(23, 18, 13);
        border-color: rgb(23, 18, 13);
        background: linear-gradient(180deg, rgb(45, 38, 30), rgb(23, 18, 13));
        color: rgb(255, 247, 239);
        box-shadow:
            var(--button-cartoon-shadow),
            var(--button-cartoon-highlight);
    }

    .auth-button {
        border: 3px solid rgb(72, 82, 199);
        border-color: rgb(72, 82, 199);
        background: linear-gradient(180deg, rgb(121, 132, 255), rgb(88, 101, 242) 58%, rgb(72, 82, 199));
        color: rgb(249, 247, 255);
        box-shadow:
            6px 7px 0 rgba(72, 82, 199, 0.28),
            inset 0 3px 0 rgba(249, 247, 255, 0.28);
    }

    .pagination button,
    .sound-options-button,
    .web-upload-secondary,
    .web-tts-enhance-button {
        border: 2px solid rgba(23, 18, 13, 0.34);
        border-color: rgba(23, 18, 13, 0.34);
        background: linear-gradient(180deg, rgba(255, 252, 247, 0.88), rgba(241, 225, 204, 0.72));
        color: rgb(23, 18, 13);
        box-shadow:
            4px 5px 0 rgba(23, 18, 13, 0.14),
            var(--button-cartoon-highlight);
    }

    .play-button.login-required,
    .play-btn.login-required,
    .web-control-button.login-required,
    .web-upload-control-button.login-required,
    .web-upload-submit.login-required,
    .play-button.error,
    .play-btn.error,
    .web-control-button.error {
        border-color: rgb(164, 43, 35);
        background: linear-gradient(180deg, rgb(218, 88, 71), rgb(164, 43, 35));
        color: rgb(255, 247, 239);
        box-shadow:
            4px 5px 0 rgba(164, 43, 35, 0.22),
            var(--button-cartoon-highlight);
    }

    .play-button.sent,
    .play-btn.sent,
    .web-control-button.sent {
        border-color: rgb(38, 112, 77);
        background: linear-gradient(180deg, rgb(72, 160, 110), rgb(38, 112, 77));
        box-shadow:
            4px 5px 0 rgba(38, 112, 77, 0.22),
            var(--button-cartoon-highlight);
    }

    .play-button.warn,
    .play-btn.warn {
        border-color: rgb(204, 139, 50);
        background: linear-gradient(180deg, rgb(239, 190, 92), rgb(204, 139, 50));
        color: rgb(23, 18, 13);
        box-shadow:
            4px 5px 0 rgba(204, 139, 50, 0.22),
            var(--button-cartoon-highlight);
    }

    .action-badge.play,
    .action-badge.favorite,
    .time-btn.active,
    .dataset-action-btn.primary {
        border-color: rgb(23, 18, 13);
        background: rgb(239, 190, 92);
        color: rgb(23, 18, 13);
    }

    .action-badge.join {
        border-color: rgb(23, 18, 13);
        background: rgb(72, 160, 110);
        color: rgb(23, 18, 13);
    }

    .action-badge.keyword {
        border-color: rgb(23, 18, 13);
        background: rgb(170, 143, 103);
        color: rgb(23, 18, 13);
    }

    html.theme-dark .theme-toggle,
    html.theme-dark .play-button,
    html.theme-dark .play-btn,
    html.theme-dark .web-control-button,
    html.theme-dark .web-upload-control-button,
    html.theme-dark .control-room-actions-trigger,
    html.theme-dark .web-upload-file-button,
    html.theme-dark .web-upload-submit,
    html.theme-dark .pagination button:not(:disabled) {
        border: 3px solid rgba(244, 240, 232, 0.5);
        border-color: rgba(244, 240, 232, 0.5);
        background: linear-gradient(180deg, rgb(31, 38, 34), rgb(18, 22, 20));
        color: rgb(244, 240, 232);
        box-shadow:
            var(--button-cartoon-shadow),
            var(--button-cartoon-highlight);
    }

    html.theme-dark .play-button.login-required,
    html.theme-dark .play-btn.login-required,
    html.theme-dark .web-control-button.login-required,
    html.theme-dark .web-upload-control-button.login-required,
    html.theme-dark .web-upload-submit.login-required,
    html.theme-dark .play-button.error,
    html.theme-dark .play-btn.error,
    html.theme-dark .web-control-button.error {
        border-color: rgb(228, 95, 73);
        background: linear-gradient(180deg, rgb(237, 121, 97), rgb(190, 59, 43));
    }

    html.theme-dark .action-badge.play,
    html.theme-dark .action-badge.favorite,
    html.theme-dark .time-btn.active,
    html.theme-dark .dataset-action-btn.primary {
        border-color: rgb(18, 22, 20);
        background: rgb(248, 202, 55);
        color: rgb(18, 22, 20);
    }

    html.theme-dark .action-badge.join {
        border-color: rgb(18, 22, 20);
        background: rgb(102, 212, 137);
        color: rgb(18, 22, 20);
    }

    html.theme-dark .action-badge.keyword {
        border-color: rgb(18, 22, 20);
        background: rgb(198, 169, 116);
        color: rgb(18, 22, 20);
    }
}

@media (max-width: 1200px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .tables-grid,
    .stats-grid,
    .main-grid {
        grid-template-columns: 1fr;
    }

    .control-room {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .page-heading {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .control-room-metrics {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.55rem 0.7rem;
    }

    .card-full {
        grid-column: auto;
    }

    .table-container {
        max-height: none;
    }
}

@media (min-width: 1201px) {
    :root {
        --table-header-height: 44px;
        --table-row-height: clamp(45px, calc((100dvh - 590px) / 7), 52px);
        --soundboard-table-height: clamp(20rem, calc(100dvh - 32rem), 34.75rem);
    }

    html.page-soundboard-root {
        height: 100dvh;
        overflow: hidden;
    }

    body.page-soundboard {
        min-height: 100dvh;
        height: 100dvh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body.page-soundboard .page-shell {
        width: min(1400px, calc(100% - 2rem));
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    body.page-soundboard .tables-grid {
        flex: 1 1 auto;
        min-height: 0;
        align-items: start;
        grid-template-rows: minmax(0, 1fr);
        overflow: hidden;
    }

    body.page-soundboard .control-room {
        flex: 0 0 auto;
    }

    body.page-soundboard .card {
        height: auto;
        min-height: 0;
        max-height: 100%;
    }

    body.page-soundboard .table-container {
        flex: 1 1 var(--soundboard-table-height);
        min-height: 0;
        height: var(--soundboard-table-height);
        overflow-y: hidden;
    }

    body.page-soundboard .pagination {
        flex: 0 0 auto;
    }

    body.page-soundboard th {
        padding-top: 0.52rem;
        padding-bottom: 0.52rem;
    }

    body.page-soundboard td {
        padding-top: 0.34rem;
        padding-bottom: 0.34rem;
    }

    body.page-soundboard .play-button {
        min-width: 2.45rem;
        min-height: 2.12rem;
        padding: 0.32rem 0.62rem;
        border-radius: 12px;
    }

    body.page-soundboard .sound-options-button {
        width: 2.12rem;
        height: 2.12rem;
        border-radius: 9px;
    }

    body.page-soundboard #filtersActions {
        min-height: 2.62rem;
    }

    body.page-soundboard .library-controls {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.55rem;
    }

    body.page-soundboard .library-controls,
    body.page-soundboard .actions-controls {
        margin-bottom: 0.45rem;
    }

    body.page-soundboard .library-controls .search-input {
        margin-bottom: 0;
    }
}

@media (min-width: 1201px) and (max-height: 900px) {
    :root {
        --table-header-height: 33px;
        --table-row-height: 37px;
        --table-bottom-inset: 0px;
    }

    body.page-soundboard .nav {
        padding-block: 0.45rem;
    }

    body.page-soundboard .nav-brand-mark {
        width: 38px;
        height: 38px;
    }

    body.page-soundboard .nav-brand-mark img {
        width: 28px;
        height: 28px;
    }

    body.page-soundboard .nav-brand-subtitle {
        display: none;
    }

    body.page-soundboard .nav-link,
    body.page-soundboard .auth-button {
        padding: 0.5rem 0.78rem;
    }

    body.page-soundboard .theme-toggle {
        width: 2.35rem;
        height: 2.35rem;
    }

    body.page-soundboard .page-shell {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    body.page-soundboard .control-room {
        gap: 0.75rem;
        margin-bottom: 0.55rem;
        padding: 0.5rem 0.75rem;
    }

    body.page-soundboard .card {
        height: 100%;
        padding: 0.72rem;
    }

    body.page-soundboard .card-header {
        margin-bottom: 0.55rem;
    }

    body.page-soundboard .card-title-stack {
        gap: 0.12rem;
    }

    body.page-soundboard .search-input,
    body.page-soundboard .filter-select {
        min-height: 2.15rem;
        padding-top: 0.42rem;
        padding-bottom: 0.42rem;
    }

    body.page-soundboard .select-shell::before {
        width: 1.62rem;
        height: 1.62rem;
    }

    body.page-soundboard .result-meta {
        min-height: 0.9rem;
        margin-bottom: 0.3rem;
        font-size: 0.66rem;
    }

    body.page-soundboard td {
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }

    body.page-soundboard .play-button {
        min-width: 2.2rem;
        min-height: 1.9rem;
        padding: 0.2rem 0.5rem;
    }

    body.page-soundboard .pagination {
        margin-top: 0.45rem;
        padding-top: 0.45rem;
    }

    body.page-soundboard .pagination button {
        padding: 0.48rem 0.72rem;
    }

    body.page-soundboard .pagination-page-input {
        width: 3.4rem;
        min-height: 2rem;
        padding-block: 0.2rem;
    }
}

@media (max-width: 820px) {
    .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .library-controls {
        grid-template-columns: 1fr;
    }

    .actions-controls {
        gap: 0.55rem;
    }

    .nav-container {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand actions"
            "links links";
        align-items: center;
        gap: 0.72rem;
    }

    .nav-brand {
        grid-area: brand;
    }

    .nav-links {
        grid-area: links;
        grid-column: 1 / -1;
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-end;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 0.35rem 0.1rem 0.1rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-actions {
        grid-area: actions;
        justify-self: end;
        gap: 0.4rem;
    }

    .nav-link,
    .auth-button,
    .auth-user-link,
    .guild-selector-shell {
        flex: 0 0 auto;
    }

    .web-upload-item {
        grid-template-columns: 1fr;
    }

    .page-shell {
        width: min(100%, calc(100% - 1.25rem));
        padding-top: 1.1rem;
    }

    .analytics-toolbar-standalone {
        justify-content: flex-start;
    }

    .page-heading {
        margin-bottom: 0.85rem;
    }

    .page-heading .page-title {
        max-width: 100%;
        font-size: clamp(1.9rem, 9vw, 2.8rem);
    }

    .hero-copy,
    .hero-panel,
    .card,
    .stat-card,
    .login-modal-card {
        border-radius: 24px;
    }

    .hero-copy,
    .hero-panel,
    .card,
    .stat-card {
        padding: 1.15rem;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .leaderboard-item {
        grid-template-columns: auto 1fr auto;
    }

    .leaderboard-item .play-btn {
        grid-column: 2 / -1;
        justify-self: start;
    }
}

@media (max-width: 640px) {
    .nav-brand-label,
    .nav-brand-subtitle,
    .nav-link,
    .auth-button,
    .auth-user-link,
    .guild-selector-shell,
    .hero-tag,
    .time-btn,
    .pagination button,
    .login-modal-close,
    .login-modal-login {
        letter-spacing: 0.06em;
    }

    .page-title {
        max-width: 100%;
        font-size: clamp(2.45rem, 12vw, 4rem);
    }

    .nav {
        position: relative;
        top: auto;
        padding: 0.62rem 0;
    }

    .nav-container,
    .page-shell {
        width: min(100%, calc(100% - 1rem));
    }

    .nav-brand {
        min-width: 0;
        gap: 0.62rem;
    }

    .nav-brand-mark {
        width: 2.9rem;
        height: 2.9rem;
        flex: 0 0 2.9rem;
    }

    .nav-brand-mark img {
        width: 2rem;
        height: 2rem;
    }

    .nav-brand-copy {
        min-width: 0;
    }

    .nav-brand-label,
    .nav-brand-subtitle {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-links {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.35rem;
        justify-content: flex-end;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0;
    }

    .nav-link {
        gap: 0.3rem;
        justify-content: center;
        flex: 1 1 0;
        min-width: 5.65rem;
        padding: 0.64rem 0.42rem;
        font-size: 0.68rem;
    }

    .nav-link .nav-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        line-height: 1;
    }

    .nav-link .nav-text {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .nav-link[href="/"],
    .nav-link[href="/analytics"],
    .nav-link[href="/speech-training"] {
        flex: 0 0 2.65rem;
        min-width: 2.65rem;
        width: 2.65rem;
        padding-inline: 0;
    }

    .guild-selector-shell {
        max-width: min(10rem, calc(100vw - 10.4rem));
        min-width: 0;
        padding: 0.58rem 0.62rem;
    }

    .guild-selector {
        max-width: 100%;
        min-width: 0;
        text-overflow: ellipsis;
    }

    .auth-button {
        justify-content: center;
        min-width: 0;
        padding: 0.62rem 0.55rem;
        gap: 0.45rem;
        box-shadow: 3px 3px 0 rgba(88, 101, 242, 0.18);
    }

    .auth-button-icon {
        width: 0.95rem;
        height: 0.95rem;
    }

    .auth-button-label {
        font-size: 0.72rem;
    }

    .auth-button-label-extended {
        display: none;
    }

    .auth-user-link {
        flex: 0 0 2.45rem;
        width: 2.45rem;
        height: 2.45rem;
        justify-content: center;
        gap: 0;
        min-width: 2.45rem;
        padding: 0.18rem;
        box-shadow: 3px 3px 0 rgba(68, 42, 18, 0.1);
    }

    .auth-avatar {
        width: 34px;
        height: 34px;
    }

    .auth-user-link::after {
        content: "🚪";
        position: absolute;
        right: 0.18rem;
        bottom: 0.12rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 0.95rem;
        height: 0.95rem;
        border-radius: 999px;
        background: rgba(255, 252, 247, 0.92);
        border: 1px solid rgba(23, 18, 13, 0.1);
        font-size: 0.58rem;
        line-height: 1;
        box-shadow: 0 1px 3px rgba(23, 18, 13, 0.18);
    }

    .auth-user-meta {
        display: none;
    }

    .theme-toggle {
        flex: 0 0 2.45rem;
        width: 2.45rem;
        height: 2.45rem;
        font-size: 0.95rem;
        box-shadow: 3px 3px 0 rgba(23, 18, 13, 0.12);
    }

    .control-room {
        position: -webkit-sticky;
        position: sticky;
        top: max(0.75rem, env(safe-area-inset-top, 0px));
        z-index: 35;
        transform: none;
        grid-template-columns: minmax(0, 1fr) minmax(0, auto) 2.35rem;
        grid-template-areas:
            "status status actions"
            "voice system actions";
        align-items: center;
        column-gap: 0.42rem;
        row-gap: 0.38rem;
        padding: 0.56rem 0.68rem;
        border-radius: 20px;
        background:
            radial-gradient(circle at 0 0, var(--accent-soft), transparent 11rem),
            linear-gradient(135deg, var(--paper-soft), var(--paper-muted));
        box-shadow: 0 8px 24px oklch(19.5% 0.024 58 / 0.18);
    }

    html.theme-dark .control-room {
        background:
            radial-gradient(circle at 0 0, var(--accent-soft), transparent 11rem),
            linear-gradient(135deg, var(--paper-soft), var(--paper-muted));
    }

    .control-room-status {
        grid-area: status;
        align-items: center;
        flex-direction: row;
        min-width: 0;
    }

    .control-room-status-main {
        gap: 0.56rem;
    }

    .control-room-metrics {
        display: contents;
    }

    .control-room-metric {
        gap: 0.26rem;
        min-height: 0;
        padding: 0;
    }

    .control-room-metric--voice {
        grid-area: voice;
    }

    .control-room-metric--system {
        grid-area: system;
    }

    .control-room-action-dock {
        grid-area: actions;
        justify-self: end;
        align-self: center;
    }

    .control-room-action-dock .control-room-actions-trigger {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.9rem;
    }

    /* Prevent sticky hover from collapsing the trigger on touch devices */
    .control-room-action-dock:hover .control-room-actions-trigger {
        width: 2.25rem;
        max-width: 2.25rem;
        opacity: 1;
        pointer-events: auto;
    }

    .control-room-action-menu {
        position: absolute;
        right: 0;
        left: auto;
        top: calc(100% + 0.35rem);
        bottom: auto;
        transform: translateY(0) scale(0.92);
        transform-origin: top right;
        gap: 0.32rem;
        padding: 0.32rem 0.36rem;
        padding-inline: 0.36rem;
        border-width: 1px;
        max-width: none;
        overflow: visible;
        transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            visibility 0s 0.18s;
    }

    .control-room-action-dock:focus-within .control-room-action-menu,
    .control-room-action-dock.open .control-room-action-menu {
        transform: translateY(0) scale(1);
        max-width: none;
        padding-inline: 0.36rem;
        border-width: 1px;
        transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            visibility 0s 0s;
    }

    .control-room-action-menu .control-room-metric-button {
        width: 1.9rem;
        height: 1.9rem;
        font-size: 0.85rem;
    }

    .control-room-metric--system {
        grid-area: system;
        justify-self: start;
        min-width: 0;
        max-width: 100%;
        overflow: visible;
    }

    .control-room-system-button strong {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.78rem;
        line-height: 1.1;
    }

    /* On mobile, use fixed positioning so the dropdown stays within the viewport
       and does not create horizontal page overflow.  Top and max-height are set
       by a JS custom properties helper. */
    .system-monitor-dropdown.open {
        position: fixed;
        top: var(--system-monitor-dropdown-top, 5rem);
        left: max(0.75rem, env(safe-area-inset-left, 0px));
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        width: auto;
        max-width: none;
        z-index: 1300;
    }

    .system-monitor-total-row {
        gap: 0.5rem;
        font-size: 0.78rem;
    }

    .system-monitor-total-label {
        font-size: 0.66rem;
    }

    .system-monitor-total-value {
        overflow-wrap: anywhere;
    }

    #systemMonitorTotalDisk {
        overflow-wrap: normal;
    }

    .control-room-metric + .control-room-metric {
        padding-left: 0;
    }

    .control-room-metric + .control-room-metric::before {
        display: none;
    }

    .control-room-metric:not(.control-room-metric--action) .control-room-metric-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .control-room-metric strong {
        max-width: 100%;
        font-size: 0.82rem;
        line-height: 1;
    }

    .control-room-title {
        margin-top: 0.04rem;
        font-size: 0.9rem;
    }

    .control-room-subtitle {
        display: none;
    }

    .control-room .card-kicker {
        display: none;
    }

    .control-room-equalizer {
        display: none;
    }

    .control-room-dot {
        width: 0.7rem;
        height: 0.7rem;
        align-self: center;
        box-shadow: 0 0 0 4px rgba(101, 88, 75, 0.12);
    }

    .web-control-button,
    .web-upload-control-button,
    .control-room-metric-button {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }

    .hero-panel-title,
    .login-modal-title {
        font-size: 1.75rem;
    }

    .filters-grid.cols-2,
    .filters-grid.cols-3 {
        grid-template-columns: 1fr;
    }

    th,
    td {
        padding: 0.42rem 0.16rem;
        font-size: 0.8rem;
    }

    .action-badge {
        max-width: 54px;
        padding: 0.22rem 0.24rem;
        font-size: 0.44rem;
    }

    #actionsTable th:first-child,
    #actionsTable td:first-child {
        width: 56px;
        max-width: 56px;
    }

    #actionsTable th:nth-child(2),
    #actionsTable td:nth-child(2) {
        width: calc(100% - 164px);
    }

    #actionsTable th:nth-child(3),
    #actionsTable td:nth-child(3) {
        width: 66px;
        max-width: 66px;
    }

    #actionsTable th:nth-child(4),
    #actionsTable td:nth-child(4) {
        width: 52px;
        max-width: 52px;
    }

    #favoritesTable th:first-child,
    #favoritesTable td:first-child {
        width: calc(100% - 92px);
    }

    #favoritesTable .sound-options-column,
    #allSoundsTable .sound-options-column {
        display: table-cell;
        text-align: center;
        overflow: visible;
    }

    #favoritesTable th:nth-child(2),
    #favoritesTable td:nth-child(2),
    #favoritesTable .sound-options-column {
        width: 46px;
    }

    #allSoundsTable th:first-child,
    #allSoundsTable td:first-child {
        width: calc(100% - 128px);
    }

    #allSoundsTable th:nth-child(2),
    #allSoundsTable td:nth-child(2) {
        width: 48px;
    }

    #allSoundsTable th:nth-child(3),
    #allSoundsTable td:nth-child(3),
    #allSoundsTable .sound-options-column {
        width: 40px;
    }

    #favoritesTable th:nth-child(2),
    #favoritesTable th.sound-options-column,
    #allSoundsTable th:nth-child(3),
    #allSoundsTable th.sound-options-column {
        font-size: 0;
        letter-spacing: 0;
        text-align: center;
    }

    #favoritesTable th:nth-child(2)::after,
    #allSoundsTable th:nth-child(3)::after {
        content: "▶";
        font-size: 0.76rem;
    }

    #favoritesTable th.sound-options-column::after,
    #allSoundsTable th.sound-options-column::after {
        content: "⋯";
        font-size: 1rem;
        line-height: 1;
    }

    .sound-options-button {
        width: 2.05rem;
        height: 2.05rem;
    }

    .heatmap {
        grid-template-columns: 28px repeat(7, minmax(0, 1fr));
        gap: 2px;
    }

    .heatmap-header {
        font-size: 0.5rem;
    }

    .heatmap-row-label {
        padding-right: 0.2rem;
        font-size: 0.52rem;
    }

    .heatmap-cell {
        min-height: 28px;
        border-radius: 3px;
    }

    .login-modal-actions {
        flex-direction: column;
    }

    .login-modal-close,
    .login-modal-login {
        width: 100%;
    }
}

/* Page change animation classes for tables */
tbody.page-swap-exit {
    opacity: 0 !important;
    transform: translateY(-4px) !important;
    transition: opacity 0.12s var(--ease-out-quint), transform 0.12s var(--ease-out-quint) !important;
}

tbody.page-swap-enter {
    opacity: 0 !important;
    transform: translateY(4px) !important;
    transition: none !important;
}

tbody.page-swap-active {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.18s var(--ease-out-quint), transform 0.18s var(--ease-out-quint) !important;
}

/* Remove top accent bars on analytics page cards and stat cards to prevent protruding green/accent lines, especially on stacked mobile layouts */
.page-analytics .card::before,
.page-analytics .stat-card::before {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .soundboard-ambient::before,
    .soundboard-ambient::after {
        animation: none !important;
        background: none !important;
    }

    .nav-brand-mark,
    .nav-brand-mark img,
    .nav-brand:hover .nav-brand-mark,
    .nav-brand:hover .nav-brand-mark img {
        transform: none !important;
    }

    .nav-link.active::after {
        animation: none !important;
        background: none !important;
    }

    .control-room-dot {
        animation: none !important;
    }

    .control-room-equalizer span {
        animation: none !important;
        opacity: 0.4;
    }

    .control-room-progress-fill::after {
        animation: none !important;
        background: none !important;
    }

    .control-room-dot.playing {
        animation: none !important;
    }

    .voice-member-row,
    .web-upload-queue-item {
        animation: none !important;
    }

    .web-upload-dialog,
    .web-tts-dialog,
    .sound-rename-dialog,
    .sound-list-dialog,
    .sound-similar-dialog,
    .sound-event-dialog,
    .web-upload-dialog::backdrop,
    .web-tts-dialog::backdrop {
        animation: none !important;
        backdrop-filter: none !important;
    }

    .play-button::before,
    .play-btn::before,
    .web-control-button::before,
    .web-upload-control-button::before,
    .sound-options-button::before,
    .pagination button::before {
        animation: none !important;
        opacity: 0 !important;
    }

    .tables-grid .card {
        animation: none !important;
        opacity: 1 !important;
    }

    body.page-dataset .dataset-sidebar,
    body.page-dataset .dataset-main,
    body.page-dataset .dataset-action-toolbar,
    body.page-dataset .dataset-user-item,
    body.page-dataset .dataset-clip,
    body.page-dataset .dataset-empty {
        animation: none !important;
        opacity: 1 !important;
    }

    .table-container.is-loading::before,
    .table-container.is-loading::after {
        animation: none !important;
        opacity: 0 !important;
    }

    .sound-hover-card,
    .voice-members-dropdown,
    .system-monitor-dropdown,
    .login-modal {
        transition: none !important;
    }

    .control-room-action-menu {
        transition: none !important;
    }

    .system-monitor-dropdown {
        right: auto;
        left: 0;
    }
}
