:root {
    --panda-black: #111111;
    --panda-white: #ffffff;
    --panda-cream: #f8f9fa;
    --panda-grey: #e9ecef;
    --panda-bamboo: #7da443;
    --panda-bamboo-light: #9dbb6d;
    --panda-radius-md: 0.75rem;
    --panda-radius-lg: 1rem;
    --panda-radius-xl: 1.5rem;
    --panda-radius-pill: 999px;
    --panda-type-page-title: 1.35rem;
    --panda-type-page-title-line-height: 1.16;
    --panda-type-page-copy: 0.95rem;
    --panda-type-section-title: 1.1rem;
    --panda-type-form-section-title: 1rem;
    --panda-type-metric: 1.4rem;
    --panda-type-control-lg: 1rem;
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
    --classification-brilliant: #18aee8;
    --classification-best: #2f8f45;
    --classification-excellent: #4f9e3d;
    --classification-good: #78a64b;
    --classification-inaccuracy: #d6a11d;
    --classification-mistake: #d86f24;
    --classification-blunder: #c9362d;
    --classification-book: #8a5a2b;
    --classification-forced: #6f8f3a;
    --classification-only-move: #4d8f5c;
    --classification-sacrifice: #18aee8;
}

body {
    background-color: var(--panda-cream);
    color: var(--panda-black);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

[hidden] {
    display: none !important;
}

.connection-status {
    position: sticky;
    top: 0;
    z-index: 2000;
    padding: 0.85rem 1rem;
    background: #fff3cd;
    color: #3d3320;
    border-bottom: 1px solid #f1d58a;
    font-weight: 800;
    font-size: 0.92rem;
    text-align: center;
}

/* Layout */
.login-shell {
    position: fixed;
    inset: 0;
    z-index: 5000;
    min-height: 100vh;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 1rem;
    padding: 1.25rem;
    overflow-y: auto;
    background: rgba(13, 16, 13, 0.72);
    backdrop-filter: blur(12px);
}

body.auth-modal-open {
    overflow: hidden;
}

.login-shell__brand,
.login-shell__content {
    width: min(100%, 430px);
    margin: 0 auto;
    color: var(--panda-white);
}

.login-shell__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-shell__content {
    display: grid;
    gap: 0.8rem;
    padding: 1.45rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--panda-radius-lg);
    background:
        linear-gradient(145deg, rgba(17, 17, 17, 0.98), rgba(35, 45, 28, 0.96)),
        var(--panda-black);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.44);
}

.login-shell__kicker {
    margin: 0;
    color: var(--panda-bamboo-light);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-shell__content h1 {
    margin: 0;
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.04;
}

.login-shell__content p:not(.login-shell__kicker) {
    max-width: 34rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.96rem;
    line-height: 1.5;
}

.login-shell__actions {
    width: min(100%, 360px);
    display: grid;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.login-shell__button {
    width: 100%;
}

.login-shell__local-form {
    width: min(100%, 360px);
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--panda-black);
    color: var(--panda-white);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    transition: margin-left var(--transition-speed);
}

/* Sidebar Styling */
.sidebar-header {
    padding: 2rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-weight: 800;
    letter-spacing: 0;
    font-size: 1.25rem;
}

.logo-text span {
    color: var(--panda-bamboo);
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.nav-item {
    margin: 0.25rem 1rem;
    border-radius: var(--panda-radius-md);
    transition: all var(--transition-speed);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 600;
}

.nav-link i {
    font-size: 1.25rem;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active .nav-link {
    color: var(--panda-white);
}

.nav-item.active .nav-link i {
    color: var(--panda-bamboo);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-panel {
    margin-bottom: 1rem;
}

.auth-login-form {
    gap: 0.5rem;
}

.auth-login-form .panda-input {
    min-height: 34px;
    border: 0;
}

.auth-login-form .auth-button {
    display: flex;
}

.auth-error {
    min-height: 1rem;
    color: #ffb4b4;
    font-size: 0.76rem;
    font-weight: 700;
}

.auth-button,
.auth-user {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: var(--panda-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--panda-white);
    padding: 0.75rem 1rem;
}

.auth-button {
    justify-content: center;
    font-weight: 800;
}

.auth-button--google {
    background: var(--panda-white);
    color: var(--panda-black);
}

.auth-button--secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
}

.auth-button:hover,
.auth-logout-button:hover {
    background: var(--panda-bamboo);
    color: var(--panda-white);
}

.auth-user {
    justify-content: space-between;
    flex-wrap: wrap;
}

.auth-user-meta {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.auth-user-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.auth-user-meta strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-logout-button {
    flex: 1 0 100%;
    width: 100%;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 0.85rem;
    border: 0;
    border-radius: var(--panda-radius-md);
    background: rgba(255, 255, 255, 0.08);
    color: var(--panda-white);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-logout-button__label {
    line-height: 1;
    white-space: nowrap;
}

.user-pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: var(--panda-radius-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--panda-bamboo);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--panda-bamboo);
}

/* App Views */
.app-view {
    display: none;
}

.app-view.active {
    display: block;
}

.view-header-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.player-form {
    min-width: min(100%, 460px);
}

.dashboard-filter-bar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-filter-controls {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-filter-control {
    min-width: 145px;
}

.dashboard-side-control {
    min-width: 150px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.dashboard-spinner-overlay {
    z-index: 10;
}

.fade-delay-1 {
    animation-delay: 0.1s;
}

.fade-delay-2 {
    animation-delay: 0.2s;
}

.fade-delay-3 {
    animation-delay: 0.3s;
}

.fade-delay-4 {
    animation-delay: 0.4s;
}

.stat-card {
    background: var(--panda-white);
    padding: 1.5rem;
    border-radius: var(--panda-surface-radius);
    border: 1px solid var(--panda-surface-border);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: var(--panda-surface-hover-shadow) !important;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: var(--panda-type-metric);
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.stat-trend {
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Opening Cards (Analyzer) */
.card {
    border-radius: var(--panda-surface-radius);
    border: 1px solid var(--panda-surface-border);
}

.card-header {
    border-bottom: 1px solid var(--panda-grey);
}

.bot-game-shell {
    display: grid;
    gap: 1rem;
    min-height: calc(100vh - 8rem);
}

.bot-game-header {
    align-items: center;
}

.bot-game-status-pill {
    min-width: 9rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(17, 17, 17, 0.10);
    border-radius: 0.5rem;
    background: #ffffff;
    color: #283123;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 10px 22px rgba(17, 17, 17, 0.06);
}

.bot-game-setup-screen,
.bot-game-game-screen {
    min-height: calc(100vh - 8rem);
}

.bot-game-setup-screen[hidden],
.bot-game-game-screen[hidden] {
    display: none !important;
}

.bot-game-setup-screen {
    display: grid;
    align-content: start;
    gap: 1.2rem;
}

.bot-game-panel {
    border: 1px solid var(--panda-surface-border);
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: var(--panda-surface-shadow);
}

.bot-game-setup-panel {
    display: grid;
    gap: 1rem;
    max-width: 42rem;
    padding: 1.1rem;
}

.bot-game-setup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.bot-game-field {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    color: #384135;
    font-size: 0.86rem;
    font-weight: 800;
}

.bot-game-profile-summary {
    min-height: 3.1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #eef4e8;
    color: #2e3a26;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.bot-game-start-button,
.bot-game-game-actions .btn,
.bot-game-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.55rem;
    border-radius: 0.5rem;
    font-weight: 800;
}

.bot-game-start-button {
    width: fit-content;
    min-width: 11rem;
}

.bot-game-message {
    min-height: 1.25rem;
    color: #44513d;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.4;
}

.bot-game-message--error {
    color: #9d2a2a;
}

.bot-game-game-screen {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.8rem;
}

.bot-game-game-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
}

.bot-game-icon-button {
    width: 2.55rem;
    min-width: 2.55rem;
    padding-inline: 0;
}

.bot-game-game-title {
    min-width: 0;
}

.bot-game-game-title .product-eyebrow {
    margin-bottom: 0.1rem;
}

.bot-game-game-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bot-game-game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem);
    align-items: start;
    gap: 1rem;
    min-height: 0;
}

.bot-game-board-stage {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 0.7rem;
    min-width: 0;
}

.bot-game-board-frame {
    width: min(100%, calc(100vh - 11rem), 72rem);
    max-width: min(100%, calc(100vw - 29rem));
    aspect-ratio: 1;
    padding: 0.35rem;
    border: 1px solid var(--panda-surface-border);
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: var(--panda-surface-shadow);
}

.bot-game-board,
.bot-game-board .cm-chessboard,
.bot-game-board .cm-chessboard svg {
    width: 100%;
    height: 100%;
}

.bot-game-board .cm-chessboard {
    display: block;
}

.bot-game-board-settings {
    width: min(100%, calc(100vh - 11rem), 72rem);
    max-width: min(100%, calc(100vw - 29rem));
    margin-top: 0;
}

.bot-game-history h2 {
    margin: 0;
    color: #111313;
    font-size: 1rem;
    font-weight: 800;
}

.bot-game-move-empty {
    color: #68715f;
}

.bot-game-history .panda-move-history {
    max-height: 31rem;
}

.bot-game-history .panda-move-history__table {
    min-width: 0;
}

.bot-game-history .panda-move-history__head,
.bot-game-history .panda-move-history__turn-row {
    grid-template-columns: 2.4rem minmax(0, 1fr) minmax(0, 1fr);
}

.bot-game-history .panda-move-history__head {
    padding-right: 0.35rem;
    padding-left: 0.35rem;
}

.bot-game-history .panda-move-history__move-label {
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .bot-game-game-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .bot-game-board-frame {
        width: min(100%, calc(100vh - 12rem), 92vw);
        max-width: 92vw;
        justify-self: center;
    }

    .bot-game-board-settings {
        width: min(100%, calc(100vh - 12rem), 92vw);
        max-width: 92vw;
        justify-self: center;
    }
}

@media (max-width: 575.98px) {
    .bot-game-setup-grid,
    .bot-game-game-topbar {
        grid-template-columns: 1fr;
    }

    .bot-game-status-pill {
        width: 100%;
    }
}

.opening-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.opening-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
}

.opening-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.03);
    padding: 0.75rem;
    border-radius: var(--panda-radius-md);
    margin-top: 1rem;
    color: #495057;
}

.opening-summary {
    line-height: 1.45;
}

.opening-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.chart-card-body {
    min-height: 18.75rem;
}

/* Inputs & Buttons */
.panda-input {
    min-height: var(--panda-control-min-height);
    border-radius: var(--panda-control-radius);
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--panda-control-border);
    background-color: var(--panda-surface);
    font-weight: 500;
}

.panda-input:focus {
    border-color: var(--panda-black);
    box-shadow: none;
}

.panda-btn,
.panda-btn-lg {
    min-height: var(--panda-control-min-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--panda-control-gap);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition:
        transform 0.2s,
        box-shadow 0.2s,
        background-color 0.2s,
        border-color 0.2s,
        color 0.2s;
}

.panda-btn {
    border-radius: var(--panda-control-radius);
    padding: 0.65rem 1.5rem;
}

.panda-btn:hover,
.panda-btn-lg:hover {
    transform: translateY(-2px);
}

.panda-btn:hover {
    box-shadow: var(--panda-control-hover-shadow);
}

.time-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.time-class-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    border: 1.5px solid var(--panda-grey);
    border-radius: var(--panda-radius-md);
    background: var(--panda-white);
    font-weight: 600;
    cursor: pointer;
}

.time-class-chip-static {
    cursor: default;
}

.time-class-chip:focus-within {
    border-color: var(--panda-black);
    box-shadow: inset 0 0 0 1px var(--panda-black);
}

.time-class-chip input {
    margin: 0;
}

.archive-window-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #6c757d;
}

.profile-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1.25rem;
    align-items: start;
}

.settings-panel {
    background: var(--panda-white);
    border: 1px solid var(--panda-surface-border);
    border-radius: var(--panda-surface-radius);
    padding: 1.5rem;
}

.settings-panel__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.settings-panel__header h2 {
    margin: 0;
    font-size: var(--panda-type-section-title);
    font-weight: 800;
}

.settings-panel__header p {
    margin: 0.15rem 0 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.settings-panel__icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    border-radius: 0.85rem;
    background: var(--panda-black);
    color: var(--panda-white);
    font-size: 1.25rem;
}

.settings-field-list {
    display: grid;
    gap: 0.8rem;
}

.settings-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--panda-grey);
}

.settings-label {
    flex: 0 0 auto;
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-value {
    min-width: 0;
    color: var(--panda-black);
    font-size: 0.98rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.settings-value--mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86rem;
}

.settings-actions {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
}

.profile-username-form {
    margin-top: 1.35rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--panda-grey);
}

.profile-username-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 575.98px) {
    .player-form {
        width: 100%;
    }

    .player-form .input-group {
        flex-direction: column;
        gap: 0.6rem;
    }

    .player-form .input-group > .form-control,
    .player-form .input-group > .panda-btn {
        width: 100%;
        border-radius: var(--panda-control-radius);
    }

    .player-form .input-group > .panda-btn {
        margin-left: 0;
    }

    .profile-username-control {
        grid-template-columns: 1fr;
    }
}

.match-scope-toggle {
    min-height: 51px;
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--panda-grey);
    border-radius: var(--panda-radius-md);
    background: var(--panda-white);
}

.match-scope-toggle .form-check-input {
    margin-top: 0;
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

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

/* Custom Loader */
.panda-loader {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    position: relative;
}

.panda-loader-inner {
    width: 100%;
    height: 100%;
    border: 4px solid var(--panda-grey);
    border-top: 4px solid var(--panda-black);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Drill Board */
#drill-board-container {
    width: min(100%, 620px);
    aspect-ratio: 1;
    padding: 0.85rem;
    border-radius: var(--panda-radius-xl);
    background: linear-gradient(145deg, #171717 0%, #232323 100%);
    box-shadow: 0 20px 40px rgba(17, 17, 17, 0.18);
}

#drill-board {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--panda-radius-lg);
}

#drill-board .cm-chessboard {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
}

#drill-board .cm-chessboard svg {
    display: block;
    border-radius: inherit;
}

@media (max-width: 575.98px) {
    .drill-replay-controls {
        width: min(100%, 92vw);
        padding: 0.85rem;
    }

    .drill-replay-controls .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    .drill-replay-button {
        width: 100%;
    }

    #drill-board-container {
        width: min(100%, 92vw);
        padding: 0.5rem;
    }
}

/* Modal Styling */
.panda-modal {
    border-radius: var(--panda-radius-xl);
}

.drill-replay-controls {
    width: min(100%, 620px);
    margin: 0 auto 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 1.15rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.96) 100%);
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.06);
    text-align: left;
}

.drill-replay-button {
    min-width: 96px;
    flex-shrink: 0;
}

.drill-replay-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #6c757d;
}

.drill-replay-status {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--panda-black);
}

.drill-replay-trail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.drill-replay-ply {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.68rem;
    border-radius: var(--panda-radius-pill);
    background: var(--panda-cream);
    color: #495057;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.drill-replay-ply.active {
    background: var(--panda-black);
    color: var(--panda-white);
    border-color: var(--panda-black);
}

.drill-replay-empty {
    font-size: 0.875rem;
    font-style: italic;
}

.drill-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--panda-radius-lg);
    z-index: 10;
}

.drill-overlay-content i {
    font-size: 5rem;
}

/* Move Classification Dev Lab */
.dev-classification-page {
    min-height: 100vh;
    background: #f5f7f3;
}

.dev-classification-shell {
    width: min(100% - 2rem, 1180px);
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
}

.dev-classification-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dev-classification-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
    color: var(--panda-black);
    text-decoration: none;
}

.dev-classification-brand .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--panda-black);
    color: var(--panda-white);
    font-weight: 800;
}

.dev-classification-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.dev-classification-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.1rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid rgba(17, 17, 17, 0.12);
    border-radius: var(--panda-radius-pill);
    background: var(--panda-white);
    color: #3d4631;
    font-size: 0.82rem;
    font-weight: 800;
}

.dev-classification-status-pill[data-tone="loading"] {
    color: #6d4b00;
    background: #fff7df;
}

.dev-classification-status-pill[data-tone="error"] {
    color: #8f1f2d;
    background: #fff0f2;
}

.dev-classification-workspace {
    display: grid;
    grid-template-columns: minmax(320px, 680px) minmax(300px, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.dev-classification-board-panel,
.dev-classification-side-panel {
    min-width: 0;
}

.dev-classification-board-container {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.55rem;
    width: min(100%, 680px);
    padding: 0.65rem;
    border-radius: 8px;
    background: transparent;
}

.dev-classification-board-stack {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    aspect-ratio: 1;
}

#dev-classification-board {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 6px;
}

#dev-classification-board .cm-chessboard,
#dev-classification-board .cm-chessboard svg {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.dev-classification-badge-layer {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}

.dev-classification-board-badge {
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 7px 12px rgba(0, 0, 0, 0.28);
    transform: translateZ(0);
}

.dev-evaluation-bar {
    position: relative;
    z-index: 7;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 0.35rem;
    flex: 0 0 2rem;
    width: 2rem;
    pointer-events: none;
}

.dev-evaluation-bar[hidden] {
    display: none !important;
}

.dev-evaluation-bar-track {
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(57, 91, 30, 0.86);
    border-radius: 10px;
    background: rgba(221, 225, 208, 0.9);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 10px 16px rgba(255, 255, 255, 0.18),
        inset 0 -10px 16px rgba(17, 45, 16, 0.28),
        0 8px 16px rgba(48, 72, 33, 0.2);
}

.dev-evaluation-bar-track::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.36) 34%, rgba(95, 105, 81, 0.2) 72%, rgba(255, 255, 255, 0.72)),
        url("eval-bar/bamboo-generated-strip.png");
    background-blend-mode: screen, luminosity;
    background-position: center, center 0;
    background-size: 100% 100%, 100% auto;
    filter: grayscale(0.98) brightness(1.34) contrast(0.86) saturate(0.28);
    opacity: 0.94;
}

.dev-evaluation-bar-track::after {
    content: "";
    position: absolute;
    inset: -48% 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.32) 18%, rgba(222, 238, 155, 0.24) 32%, transparent 52%);
    mix-blend-mode: screen;
    opacity: 0;
}

.dev-evaluation-bar.is-changing .dev-evaluation-bar-track::after {
    animation: dev-bamboo-eval-flow 720ms ease-out 1;
}

.dev-evaluation-fill {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    height: 50%;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.02) 28%, rgba(11, 43, 14, 0.18) 72%, rgba(255, 255, 255, 0.18)),
        url("eval-bar/bamboo-generated-strip.png");
    background-blend-mode: soft-light, normal;
    background-position: center, center bottom;
    background-size: 100% 100%, 100% auto;
    transition: height 560ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
    will-change: height;
}

@keyframes dev-bamboo-eval-flow {
    from {
        opacity: 0;
        transform: translateY(-28%);
    }

    24% {
        opacity: 0.86;
    }

    to {
        opacity: 0;
        transform: translateY(28%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dev-evaluation-bar-track::after {
        animation: none;
    }
}

.dev-evaluation-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.25rem;
    padding: 0;
    background: transparent;
    color: #2f4a1d;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    line-height: 1;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.92),
        0 0 5px rgba(255, 255, 255, 0.76),
        0 2px 6px rgba(40, 55, 31, 0.26);
}

.dev-classification-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.dev-classification-toolbar .btn {
    min-width: 2.55rem;
}

.dev-settings-toggle {
    margin-left: auto;
}

.dev-board-settings-panel {
    margin-top: 0.85rem;
    padding: 0.95rem;
    border: 1px solid rgba(17, 17, 17, 0.1);
    border-radius: 8px;
    background: var(--panda-white);
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
}

.dev-board-settings-panel[hidden] {
    display: none !important;
}

.dev-board-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.dev-board-settings-grid label,
.dev-board-settings-toggles label {
    min-width: 0;
    color: #4d5748;
    font-size: 0.78rem;
    font-weight: 800;
}

.dev-board-settings-grid label {
    display: grid;
    gap: 0.3rem;
}

.dev-board-settings-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.95rem;
    margin-top: 0.85rem;
}

.dev-board-settings-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.dev-board-settings-toggles input {
    accent-color: var(--panda-bamboo);
}

.dev-classification-side-panel {
    display: grid;
    gap: 0.9rem;
}

.dev-classification-controls,
.dev-classification-card {
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 8px;
    background: var(--panda-white);
    box-shadow: 0 10px 26px rgba(17, 17, 17, 0.06);
}

.dev-classification-controls {
    padding: 1rem;
}

.dev-fen-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    resize: vertical;
}

.dev-classification-control-row {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.75rem;
    align-items: end;
    margin-top: 0.85rem;
}

.dev-classification-card {
    padding: 1rem;
}

.dev-classification-card-title {
    margin-bottom: 0.75rem;
    color: #5c6356;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dev-latest-classification {
    min-height: 6.6rem;
}

.dev-latest-classification-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dev-classification-inline-badge {
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
}

.dev-classification-pending-badge,
.dev-classification-error-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    border-radius: 50%;
    font-weight: 800;
}

.dev-classification-pending-badge {
    border: 4px solid var(--panda-white);
    background: conic-gradient(from 20deg, var(--panda-bamboo), var(--panda-bamboo-light), var(--panda-black), var(--panda-bamboo));
    box-shadow: inset 0 0 0 6px var(--panda-cream);
}

.dev-classification-error-badge {
    border: 4px solid var(--panda-white);
    background: #3d2f20;
    color: var(--panda-white);
    box-shadow: inset 0 0 0 3px #f1d58a;
}

.dev-latest-classification-label {
    font-size: 1.25rem;
    font-weight: 800;
}

.dev-latest-classification-move {
    color: #5c6356;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 800;
}

.dev-classification-metrics {
    display: grid;
    gap: 0.45rem;
    margin: 0.9rem 0 0;
}

.dev-classification-metrics div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.dev-classification-metrics dt,
.dev-classification-metrics dd {
    margin: 0;
    font-size: 0.88rem;
}

.dev-classification-metrics dt {
    color: #687062;
    font-weight: 800;
}

.dev-classification-metrics dd {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

.dev-classification-history {
    display: grid;
    gap: 0.45rem;
    max-height: 18rem;
    margin: 0;
    padding-left: 1.25rem;
    overflow-y: auto;
}

.dev-classification-history li {
    padding: 0.45rem 0;
}

.dev-history-move {
    display: inline-flex;
    min-width: 5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
}

.dev-history-grade {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #30382d;
    font-size: 0.9rem;
    font-weight: 800;
}

.dev-history-grade img {
    width: 1.45rem;
    height: 1.45rem;
}

.dev-history-grade-pending {
    color: #59633f;
}

.dev-history-grade-error {
    color: #8f1f2d;
}

.dev-history-pending-dot,
.dev-history-error-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
}

.dev-history-pending-dot {
    background: var(--panda-bamboo-light);
    box-shadow: inset 0 0 0 4px var(--panda-cream);
}

.dev-history-error-dot {
    background: #3d2f20;
    color: var(--panda-white);
}

.panda-move-history {
    display: block;
    max-height: 18rem;
    overflow: auto;
    color: #0f141d;
}

.panda-move-history-empty {
    color: #6b705f;
    font-size: 0.9rem;
}

.panda-move-history__table {
    min-width: 34rem;
}

.panda-move-history__head,
.panda-move-history__turn-row {
    display: grid;
    grid-template-columns: 5.2rem minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
}

.panda-move-history__head {
    padding: 0 0.55rem 0.52rem;
    border-bottom: 1px solid rgba(18, 24, 38, 0.12);
    color: #374151;
    font-size: 0.86rem;
    font-weight: 900;
}

.panda-move-history__head-cell--number {
    text-align: center;
}

.panda-move-history__body {
    margin: 0;
    padding: 0;
    list-style: none;
}

.panda-move-history__turn {
    position: relative;
}

.panda-move-history__turn-row {
    min-height: 2.12rem;
    padding: 0 0.55rem;
    border-bottom: 1px solid rgba(18, 24, 38, 0.09);
}

.panda-move-history__turn--active .panda-move-history__turn-row {
    border-radius: 8px;
    border-bottom-color: transparent;
    background: linear-gradient(90deg, rgba(226, 237, 210, 0.92), rgba(238, 244, 224, 0.82));
    box-shadow: inset 0 0 0 1px rgba(49, 99, 35, 0.1);
}

.panda-move-history__number {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    color: #0f141d;
    font-weight: 500;
}

.panda-move-history__active-dot {
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #3b7c27;
}

.panda-move-history__move-cell {
    display: grid;
    grid-template-columns: minmax(3.8rem, 4.5rem) max-content;
    gap: 0.42rem;
    min-width: 0;
    align-items: center;
    padding-right: 0.65rem;
}

.panda-move-history__move-cell--active {
    scroll-margin-block: 5rem;
}

.panda-move-history__move-cell--empty {
    min-height: 1.75rem;
}

.panda-move-history__move-button {
    display: grid;
    grid-template-columns: minmax(3.8rem, 4.5rem) max-content;
    gap: 0.42rem;
    width: 100%;
    min-width: 0;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.panda-move-history__move-button:focus-visible,
.panda-move-history__variation-token--move:focus-visible {
    outline: 2px solid rgba(59, 124, 39, 0.72);
    outline-offset: 3px;
}

.panda-move-history__move-label {
    min-width: 0;
    color: #0d121a;
    font-size: 0.95rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panda-move-history__move-label-wrap {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.22rem;
}

.panda-move-history__move-label-wrap .panda-move-history__move-label {
    flex: 0 1 auto;
}

.panda-move-history__move-label-wrap[data-move-classification-badge="brilliant"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="brilliant"] {
    color: var(--classification-brilliant);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="checkmate"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="checkmate"] {
    color: var(--classification-brilliant);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="best"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="best"] {
    color: var(--classification-best);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="excellent"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="excellent"] {
    color: var(--classification-excellent);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="good"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="good"] {
    color: var(--classification-good);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="book"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="book"] {
    color: var(--classification-book);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="forced"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="forced"] {
    color: var(--classification-forced);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="only_move"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="only_move"] {
    color: var(--classification-only-move);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="sacrifice"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="sacrifice"] {
    color: var(--classification-sacrifice);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="inaccuracy"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="inaccuracy"] {
    color: var(--classification-inaccuracy);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="mistake"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="mistake"] {
    color: var(--classification-mistake);
}

.panda-move-history__move-label-wrap[data-move-classification-badge="blunder"] .panda-move-history__move-label,
.panda-move-history__variation-token--move[data-move-classification-badge="blunder"] {
    color: var(--classification-blunder);
}

.panda-move-history__move-label--active {
    border-radius: 0.22rem;
    background: rgba(18, 24, 38, 0.14);
    box-shadow: 0 0 0 0.22rem rgba(18, 24, 38, 0.14);
}

.panda-move-history__classification-badge {
    width: 0.95em;
    height: 0.95em;
    flex: 0 0 auto;
    object-fit: contain;
    vertical-align: -0.12em;
}

.panda-move-history__classification-badge--variation {
    margin-left: 0.2rem;
}

.panda-move-history__move-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.18em;
    padding: 0 0.24rem;
    border-radius: 999px;
    background: rgba(82, 92, 72, 0.12);
    color: #5a624f;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.18;
    white-space: nowrap;
}

.panda-move-history__move-status--pending {
    background: rgba(59, 124, 39, 0.13);
    color: #2f6d21;
}

.panda-move-history__move-status--error {
    background: rgba(143, 31, 45, 0.13);
    color: #8f1f2d;
}

.panda-move-history__move-status--blunder {
    background: color-mix(in srgb, var(--classification-blunder) 15%, transparent);
    color: var(--classification-blunder);
}

.panda-move-history__move-status--mistake {
    background: color-mix(in srgb, var(--classification-mistake) 15%, transparent);
    color: var(--classification-mistake);
}

.panda-move-history__move-status--brilliant {
    background: color-mix(in srgb, var(--classification-brilliant) 15%, transparent);
    color: var(--classification-brilliant);
}

.panda-move-history__move-status--checkmate {
    background: color-mix(in srgb, var(--classification-brilliant) 15%, transparent);
    color: var(--classification-brilliant);
}

.panda-move-history__move-status--best {
    background: color-mix(in srgb, var(--classification-best) 15%, transparent);
    color: var(--classification-best);
}

.panda-move-history__move-status--excellent {
    background: color-mix(in srgb, var(--classification-excellent) 15%, transparent);
    color: var(--classification-excellent);
}

.panda-move-history__move-status--good {
    background: color-mix(in srgb, var(--classification-good) 16%, transparent);
    color: var(--classification-good);
}

.panda-move-history__move-status--inaccuracy {
    background: color-mix(in srgb, var(--classification-inaccuracy) 18%, transparent);
    color: var(--classification-inaccuracy);
}

.panda-move-history__move-status--book {
    background: color-mix(in srgb, var(--classification-book) 16%, transparent);
    color: var(--classification-book);
}

.panda-move-history__move-status--forced {
    background: color-mix(in srgb, var(--classification-forced) 16%, transparent);
    color: var(--classification-forced);
}

.panda-move-history__move-status--only_move {
    background: color-mix(in srgb, var(--classification-only-move) 16%, transparent);
    color: var(--classification-only-move);
}

.panda-move-history__move-status--sacrifice {
    background: color-mix(in srgb, var(--classification-sacrifice) 15%, transparent);
    color: var(--classification-sacrifice);
}

.panda-move-history__move-meta {
    display: inline-grid;
    grid-template-columns: max-content max-content;
    column-gap: 0.08rem;
    row-gap: 0;
    align-items: center;
    justify-self: start;
    width: max-content;
    color: #333946;
    font-size: 0.72rem;
    line-height: 1.18;
}

.panda-move-history__bar {
    display: block;
    height: 1.18em;
    overflow: hidden;
    border-radius: 999px;
    background: transparent;
}

.panda-move-history__bar span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #2d6f20;
}

.panda-move-history__time {
    font-variant-numeric: tabular-nums;
}

.panda-move-history__variation-list {
    --variation-depth: 0;
    position: relative;
    display: grid;
    margin: 0;
    padding: 0;
}

.panda-move-history__variation-branch {
    position: relative;
    display: block;
}

.panda-move-history__variation-line {
    --variation-depth: 0;
    position: relative;
    display: grid;
    grid-template-columns: 5.2rem minmax(0, 1fr);
    min-height: 2.45rem;
    align-items: center;
    padding: 0.42rem 0.55rem;
    border-bottom: 1px solid rgba(18, 24, 38, 0.06);
    background: rgba(18, 24, 38, 0.025);
    color: #495166;
    font-size: 0.92rem;
    line-height: 1.55;
}

.panda-move-history__variation-line--active {
    background: linear-gradient(90deg, rgba(226, 237, 210, 0.92), rgba(238, 244, 224, 0.78));
    box-shadow: inset 0 0 0 1px rgba(49, 99, 35, 0.1);
}

.panda-move-history__variation-marker {
    display: block;
    width: 2px;
    height: calc(100% - 0.72rem);
    min-height: 1.65rem;
    justify-self: center;
    border-radius: 999px;
    background: rgba(82, 92, 72, 0.58);
    transform: translateX(calc(var(--variation-depth, 0) * 1.15rem));
}

.panda-move-history__variation-line--active .panda-move-history__variation-marker {
    background: #3b7c27;
}

.panda-move-history__variation-text,
.panda-move-history__variation-notation {
    min-width: 0;
    padding-left: calc(var(--variation-depth, 0) * 1.15rem);
    overflow-wrap: anywhere;
}

.panda-move-history__variation-token {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    vertical-align: baseline;
}

.panda-move-history__variation-token--move {
    cursor: pointer;
}

.panda-move-history__variation-token--number {
    color: #626b75;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.panda-move-history__variation-token--move {
    color: #343a46;
    font-weight: 900;
}

.panda-move-history__variation-token--active {
    scroll-margin-block: 5rem;
    border-radius: 0.22rem;
    background: rgba(18, 24, 38, 0.16);
    box-shadow: 0 0 0 0.22rem rgba(18, 24, 38, 0.16);
}

.panda-move-history__variation-nested,
.panda-move-history__variation-parenthetical {
    display: inline;
    color: #626b75;
}

.panda-move-history__variation-paren {
    color: #626b75;
    font-weight: 800;
}

.panda-move-history__variation-parenthetical .panda-move-history__variation-paren:first-child {
    margin-right: 0.48rem;
}

.panda-move-history__variation-parenthetical .panda-move-history__variation-paren:last-child {
    margin-left: 0.48rem;
}

@media (max-width: 920px) {
    .dev-classification-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dev-classification-workspace {
        grid-template-columns: 1fr;
    }

    .dev-classification-board-container {
        width: min(100%, 92vw);
    }

    .dev-board-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .dev-classification-shell {
        width: min(100% - 1rem, 1180px);
        padding-top: 1rem;
    }

    .dev-classification-control-row {
        grid-template-columns: 1fr;
    }

    .dev-classification-toolbar .btn {
        flex: 1 1 auto;
    }
}

/* Compact Opening List (Dashboard) */
.opening-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.opening-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--panda-cream);
    border-radius: var(--panda-radius-md);
}

.opening-item-info {
    display: flex;
    flex-direction: column;
}

.opening-item-name {
    font-weight: 700;
    font-size: 0.9375rem;
}

.opening-item-stats {
    font-size: 0.75rem;
    color: #6c757d;
}

.opening-item-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.opening-list-note {
    color: #6c757d;
    font-size: 0.8125rem;
    line-height: 1.4;
    padding: 0 0.25rem;
}

/* Filter Card Enhancements (Panda Theme) */
.panda-filter-card {
    border-radius: var(--panda-radius-xl);
    background: var(--panda-white);
    border: 1px solid var(--panda-grey);
}

.filter-section-title {
    font-size: var(--panda-type-form-section-title);
    font-weight: 800;
    color: var(--panda-black);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-section-title i {
    color: var(--panda-bamboo);
    font-size: 1.05rem;
}

.panda-divider {
    border-color: var(--panda-grey);
    opacity: 0.7;
}

.input-group-text {
    border-radius: var(--panda-control-radius) 0 0 var(--panda-control-radius);
    border: 1.5px solid var(--panda-control-border);
    background-color: var(--panda-surface);
}

.panda-input.border-start-0 {
    border-radius: 0 var(--panda-control-radius) var(--panda-control-radius) 0;
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .panda-input {
    border-color: var(--panda-black);
}

.panda-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    background-color: var(--panda-grey);
    border-color: var(--panda-grey);
    cursor: pointer;
}

.panda-switch .form-check-input:checked {
    background-color: var(--panda-bamboo);
    border-color: var(--panda-bamboo);
}

.panda-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(125, 164, 67, 0.25);
    border-color: var(--panda-bamboo);
}

.panda-switch .form-check-label {
    margin-top: 0.2rem;
    margin-left: 0.5rem;
    cursor: pointer;
}

/* Match Scope Segmented Control */
.match-scope-container {
    border-color: var(--panda-grey) !important;
}

.scope-label {
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--panda-black);
}

.scope-label:has(input:checked) {
    background-color: var(--panda-cream);
    color: var(--panda-bamboo);
}

.scope-label:hover:not(:has(input:checked)) {
    background-color: rgba(0,0,0,0.02);
}

.match-scope-divider {
    width: 1.5px;
    height: 24px;
}

.last-matches-input {
    width: 3.75rem;
    min-height: 1.75rem;
}

.panda-btn-lg {
    min-height: var(--panda-control-lg-min-height);
    border-radius: var(--panda-control-lg-radius);
    padding: 0.85rem 1.5rem;
    font-weight: 800;
    font-size: var(--panda-type-control-lg);
    background: var(--panda-black);
    color: var(--panda-white);
    border: none;
}

.panda-btn-lg:hover {
    background: var(--panda-bamboo);
    transform: translateY(-3px);
    box-shadow: var(--panda-control-lg-hover-shadow) !important;
    color: var(--panda-white);
}

.product-dashboard-shell,
.category-plan-view,
.drill-session-view,
.progress-view {
    display: grid;
    gap: 1.25rem;
}

.onboarding-panel,
.category-summary-card,
.bucket-detail,
.drill-session-card,
.progress-card,
.empty-category-state {
    background: var(--panda-white);
    border: 1px solid #dfe4ea;
    border-radius: 0.5rem;
}

.onboarding-panel {
    overflow: hidden;
}

.onboarding-panel__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem;
    border-left: 5px solid #2f80ed;
}

.onboarding-panel__content--compact {
    border-left-color: var(--panda-bamboo);
}

.onboarding-panel__content--warning {
    border-left-color: #c8553d;
}

.product-eyebrow {
    margin: 0 0 0.35rem;
    color: #2f80ed;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.onboarding-panel h2,
.bucket-detail h2,
.drill-session-card h2,
.progress-card h2,
.empty-category-state h2,
.category-summary-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0;
}

.onboarding-panel p,
.category-summary-card p,
.bucket-detail p,
.drill-session-card p,
.progress-card p,
.empty-category-state p {
    margin: 0.35rem 0 0;
    color: #5f6b76;
    line-height: 1.45;
}

.onboarding-username-form {
    width: min(100%, 420px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.onboarding-username-form__label {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--panda-ink-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.analysis-loading-indicator {
    display: flex;
    gap: 0.4rem;
}

.analysis-loading-indicator span {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #2f80ed;
    animation: productPulse 1.1s infinite ease-in-out;
}

.analysis-loading-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.analysis-loading-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes productPulse {
    0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}

.category-summary-grid,
.drill-card-grid,
.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.category-summary-card,
.drill-session-card,
.progress-card,
.bucket-detail {
    padding: 1rem;
}

.category-summary-card {
    display: grid;
    gap: 0.85rem;
    min-height: 230px;
}

.category-summary-card__header,
.bucket-detail__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.category-chip,
.status-pill,
.rank-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--panda-radius-pill);
    font-size: 0.76rem;
    font-weight: 800;
}

.category-chip--blitz {
    background: #fff0e9;
    color: #9a3b14;
}

.category-chip--rapid {
    background: #eaf3ff;
    color: #1d5d9f;
}

.status-pill {
    background: #eef1f4;
    color: #3d4650;
}

.rank-badge {
    flex: 0 0 auto;
    background: var(--panda-black);
    color: var(--panda-white);
}

.category-summary-card__metric {
    color: var(--panda-black);
    font-weight: 800;
}

.bucket-detail-list {
    display: grid;
    gap: 1rem;
}

.category-secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.bucket-detail__summary {
    justify-content: flex-start;
    align-items: flex-start;
}

.bucket-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.bucket-metrics div {
    min-width: 0;
    padding: 0.75rem;
    background: #f3f6f8;
    border-radius: 0.5rem;
}

.bucket-metrics strong {
    display: block;
    font-size: 1.2rem;
    line-height: 1.1;
}

.bucket-metrics span {
    color: #5f6b76;
    font-size: 0.75rem;
    font-weight: 700;
}

.representative-grid,
.bucket-drill-list,
.progress-bucket-list {
    display: grid;
    gap: 0.65rem;
}

.representative-position {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem;
    background: #fbfcfd;
    border: 1px solid #edf0f2;
    border-radius: 0.5rem;
}

.representative-position span {
    font-weight: 800;
}

.representative-position code {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #46515c;
}

.bucket-drill-list {
    margin-top: 1rem;
    justify-items: start;
}

.drill-session-card {
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.empty-category-state {
    min-height: 280px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.empty-category-state i {
    font-size: 2rem;
    color: #2f80ed;
}

.progress-card {
    display: grid;
    gap: 0.9rem;
}

.progress-bucket-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-top: 1px solid #edf0f2;
}

.progress-bucket-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
    }

    .sidebar-header {
        padding: 0.5rem 0;
    }

    .nav-list {
        display: flex;
        flex-direction: row;
        margin: 0 auto 0 0 !important;
        overflow-x: auto;
        gap: 0.5rem;
    }

    .nav-item {
        margin: 0 0.25rem;
    }

    .sidebar-footer {
        padding: 0.5rem 0;
        border-top: none;
        margin-left: auto;
    }

    .app-container {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .onboarding-panel__content {
        align-items: stretch;
        flex-direction: column;
    }

    .loading-puzzle-panel {
        width: 100%;
        margin-left: 0;
    }

    .onboarding-username-form,
    .bucket-metrics,
    .category-secondary-grid {
        grid-template-columns: 1fr;
    }
}

/* PandaTakes dashboard skin */
:root {
    --panda-black: #111313;
    --panda-cream: #f7f8f4;
    --panda-surface: #ffffff;
    --panda-border: #dde3d8;
    --panda-bamboo: #789a4b;
    --panda-bamboo-dark: #4f6d2f;
    --panda-bamboo-soft: #eef4e8;
    --panda-ink-muted: #555c61;
    --panda-control-min-height: 3rem;
    --panda-control-lg-min-height: 3.25rem;
    --panda-control-radius: 0.55rem;
    --panda-control-lg-radius: 1rem;
    --panda-control-gap: 0.55rem;
    --panda-control-border: rgba(17, 19, 19, 0.14);
    --panda-control-hover-shadow: 0 4px 12px rgba(0,0,0,0.15);
    --panda-control-lg-hover-shadow: 0 8px 20px rgba(125, 164, 67, 0.3);
    --panda-surface-radius: 0.5rem;
    --panda-surface-border: rgba(17, 19, 19, 0.11);
    --panda-surface-shadow: 0 14px 30px rgba(22, 28, 20, 0.10);
    --panda-surface-hover-shadow: 0 10px 20px rgba(0,0,0,0.08);
    --sidebar-width: 318px;
}

body {
    background:
        radial-gradient(circle at 62% 0%, rgba(120, 154, 75, 0.08), transparent 28rem),
        linear-gradient(180deg, #fbfbf8 0%, var(--panda-cream) 100%);
    color: var(--panda-black);
}

.app-container {
    background: transparent;
}

.main-content {
    box-sizing: border-box;
    width: calc(100% - var(--sidebar-width));
    padding: 0 1.4rem 2.65rem 2.5rem;
}

.sidebar {
    overflow: hidden;
    background:
        radial-gradient(circle at 45% 15%, rgba(255, 255, 255, 0.06), transparent 15rem),
        linear-gradient(140deg, #171818 0%, #0d0f0f 72%, #171a15 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 18px 0 34px rgba(17, 19, 19, 0.18);
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar::after {
    content: "";
    position: absolute;
    left: 2.2rem;
    top: 30.2rem;
    bottom: auto;
    z-index: 0;
    width: 15.1rem;
    height: 19rem;
    background: url("assets/sidebar-bamboo.png") left bottom / auto 100% no-repeat;
    opacity: 0.88;
    pointer-events: none;
}

.sidebar-header {
    padding: 3rem 2.15rem 1.6rem 1.95rem;
}

.logo {
    gap: 0.55rem;
    min-width: 0;
}

.logo-mark {
    width: 4.2rem;
    height: 4.2rem;
    flex: 0 0 4.2rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
}

.logo-mark--sidebar {
    width: 4.15rem;
    height: 4.15rem;
    flex-basis: 4.15rem;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
}

.login-shell__brand .logo-mark {
    width: 3.5rem;
    height: 3.5rem;
    flex-basis: 3.5rem;
}

.logo-copy {
    display: grid;
    gap: 0.14rem;
    min-width: 0;
    padding-top: 1rem;
}

.logo-text {
    display: inline-block;
    color: #ffffff;
    font-size: 1.04rem;
    line-height: 1;
    letter-spacing: 0;
}

.login-shell__content h1 {
    font-size: 2.1rem;
}

.logo-subtitle {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.63rem;
    font-weight: 600;
}

.nav-list {
    margin-top: 1.7rem !important;
    padding: 0 1rem;
}

.nav-item {
    margin: 0.48rem 0;
    border-radius: var(--panda-radius-md);
}

.nav-link {
    min-height: 3.08rem;
    padding: 0.78rem 0.95rem 0.78rem 1.18rem;
    gap: 0.78rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    font-weight: 560;
}

.nav-link i {
    width: 1.9rem;
    font-size: 1.12rem;
    color: rgba(255, 255, 255, 0.72);
}

.nav-item:hover,
.nav-item.active {
    background: linear-gradient(90deg, rgba(120, 154, 75, 0.32), rgba(120, 154, 75, 0.17));
    box-shadow: inset 0 0 0 1px rgba(156, 175, 114, 0.42);
}

.nav-item.active .nav-link i,
.nav-item:hover .nav-link i {
    color: #ffffff;
}

.nav-paw {
    width: 1.45rem;
    height: 1.45rem;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-item.active .nav-paw {
    opacity: 0.88;
}

.sidebar-footer {
    position: relative;
    z-index: 1;
    padding: 1.4rem 1rem 3rem;
    border-top: 0;
}

.auth-panel {
    margin-bottom: 1.25rem;
}

.auth-user {
    min-height: 6.1rem;
    padding: 1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-avatar {
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 3.25rem;
    border-radius: 50%;
    object-fit: cover;
}

.auth-user-label {
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.04em;
}

.auth-user-meta strong {
    max-width: 100%;
    color: #ffffff;
}

.auth-logout-button {
    width: 100%;
    height: 3.1rem;
    flex-basis: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--panda-radius-md);
}

.user-pill {
    min-height: 4.5rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font-weight: 800;
}

.user-pill i {
    font-size: 1.55rem;
    color: rgba(255, 255, 255, 0.78);
}

.product-dashboard-shell,
#legacy-dashboard-content {
    width: min(100%, 73.25rem);
}

.product-dashboard-shell {
    gap: 1.65rem;
}

.product-hero {
    position: relative;
    min-height: 10rem;
    display: flex;
    align-items: flex-start;
    padding-top: 2.75rem;
    overflow: visible;
    background: transparent;
}

.product-hero::after {
    content: "";
    position: absolute;
    inset: 0 min(0px, calc(var(--sidebar-width) + 2.65rem + 100% - 100vw)) auto auto;
    z-index: 0;
    width: min(57rem, 61%);
    height: 14.1rem;
    background: url("assets/dashboard-hero.png") right top / auto 100% no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 22%, #000 52%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0%, transparent 22%, #000 52%, #000 100%);
    opacity: 0.96;
    pointer-events: none;
}

.product-hero__copy {
    position: relative;
    z-index: 1;
    max-width: 43rem;
}

.product-hero h1,
.section-heading h1 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    color: #111313;
    font-size: 2.35rem;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: 0;
}

.product-hero p,
.section-heading p {
    margin: 0.7rem 0 0;
    color: var(--panda-ink-muted);
    font-size: 1.04rem;
    line-height: 1.5;
}

.view-header h1 {
    margin: 0;
    font-size: var(--panda-type-page-title);
    line-height: var(--panda-type-page-title-line-height);
    letter-spacing: 0;
}

.view-header p,
.section-heading p {
    font-size: var(--panda-type-page-copy);
}

.title-sprig {
    width: 3rem;
    height: 2rem;
    object-fit: contain;
}

.title-sprig--small {
    width: 2.65rem;
    height: 1.85rem;
}

.product-status {
    min-height: 3.9rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(120, 154, 75, 0.28);
    background: linear-gradient(90deg, rgba(238, 244, 232, 0.92), rgba(255, 255, 255, 0.96));
    color: #33471f;
    font-weight: 700;
}

.product-status img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
}

.product-status--danger,
.product-status--warning {
    border-color: rgba(199, 125, 62, 0.28);
    background: #fff8ec;
    color: #6d401b;
}

.onboarding-panel,
.category-summary-card,
.stat-card,
.card,
.settings-panel {
    border-radius: var(--panda-surface-radius);
    border-color: var(--panda-surface-border);
    box-shadow: var(--panda-surface-shadow) !important;
}

.onboarding-panel {
    position: relative;
    min-height: 8.4rem;
    overflow: hidden;
    background:
        url("assets/analysis-card-left.png") left center / auto 182% no-repeat,
        linear-gradient(90deg, rgba(238, 244, 232, 0.88), rgba(255, 255, 255, 0.98) 27%, #ffffff 100%);
}

.category-summary-card::after {
    content: "";
    position: absolute;
    right: -1.1rem;
    bottom: 2.4rem;
    width: 8.2rem;
    height: 9.4rem;
    background: url("assets/card-bamboo-watermark.png") right bottom / auto 100% no-repeat;
    opacity: 0.40;
    pointer-events: none;
}

.onboarding-panel::after {
    display: none;
}

.onboarding-panel__content {
    min-height: 8.4rem;
    justify-content: flex-start;
    padding: 1.25rem 2.05rem 1.25rem 2.85rem;
    border-left: 5px solid var(--panda-bamboo);
}

.onboarding-panel__art {
    width: 5.65rem;
    height: 5.65rem;
    flex: 0 0 5.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    color: var(--panda-bamboo);
    font-size: 2.1rem;
    box-shadow: 0 12px 22px rgba(22, 28, 20, 0.10);
}

.onboarding-panel__content > div:not(.onboarding-panel__art) {
    min-width: 0;
}

.product-eyebrow {
    margin-bottom: 0.45rem;
    color: var(--panda-bamboo-dark);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

.onboarding-panel h2,
.category-summary-card h3 {
    color: #111313;
    font-size: 1.25rem;
}

.onboarding-panel p,
.category-summary-card p {
    color: #475058;
    font-size: 1rem;
}

.analysis-loading-indicator {
    margin-left: auto;
    padding-right: 0.55rem;
    align-self: center;
}

.analysis-loading-indicator span {
    width: 0.72rem;
    height: 0.72rem;
    background: var(--panda-bamboo);
}

.loading-puzzle-panel {
    width: auto;
    margin-left: auto;
}

.loading-puzzle-launcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.loading-puzzle-launcher .panda-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

#loading-puzzle-board-container {
    width: min(100%, 560px);
    aspect-ratio: 1;
    padding: 0.7rem;
    border-radius: var(--panda-radius-xl);
    background: linear-gradient(145deg, #171717 0%, #232323 100%);
    box-shadow: 0 20px 40px rgba(17, 17, 17, 0.18);
}

#loading-puzzle-board {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--panda-radius-lg);
}

#loading-puzzle-board .cm-chessboard {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
}

#loading-puzzle-board .cm-chessboard svg {
    display: block;
    border-radius: inherit;
}

.loading-puzzle-modal-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
}

#loading-puzzle-feedback[data-tone="danger"] {
    color: #b42318;
}

.loading-puzzle-line {
    margin-top: 0.4rem;
    color: #111313;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.category-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.category-summary-card {
    position: relative;
    gap: 0.65rem;
    min-height: 16.1rem;
    overflow: hidden;
    padding: 1.55rem 1.65rem 1.35rem;
    background: #ffffff;
}

.category-summary-card__header {
    position: relative;
    z-index: 1;
}

.category-summary-card__title {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--panda-bamboo-dark);
    font-size: 1.25rem;
    font-weight: 800;
}

.category-summary-card__icon {
    width: 3.05rem;
    height: 3.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--panda-bamboo);
    color: #ffffff;
    font-size: 1.55rem;
}

.status-pill {
    min-height: 2.1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.65rem;
    background: #edf3e8;
    color: #3b5424;
    text-transform: lowercase;
}

.category-summary-card h3 {
    position: relative;
    z-index: 1;
    margin-top: 1rem;
    font-size: 1.28rem;
}

.category-summary-card p {
    position: relative;
    z-index: 1;
    min-height: 3rem;
    max-width: 27rem;
}

.category-summary-card__metric {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.15rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(17, 19, 19, 0.14);
    font-size: 1rem;
}

.category-summary-card__metric i {
    color: var(--panda-bamboo);
    font-size: 1.45rem;
}

.category-summary-card .panda-btn {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: var(--panda-control-min-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--panda-control-gap);
    margin-top: auto;
    border-color: var(--panda-bamboo-dark);
    color: #2f421f;
    background: var(--panda-surface);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.category-summary-card .panda-btn:hover {
    background: var(--panda-bamboo);
    border-color: var(--panda-bamboo);
    color: #ffffff;
}

.button-paw {
    width: 1.25rem;
    height: 1.25rem;
}

.category-summary-card .panda-btn:hover .button-paw {
    filter: brightness(0) invert(1);
}

#legacy-dashboard-content {
    margin-top: 0.9rem;
}

.player-insights-panel {
    margin-bottom: 1.65rem;
}

.player-insights-header {
    align-items: end;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: min(100%, 30rem);
}

.section-heading__avatar {
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 3.25rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 18px rgba(22, 28, 20, 0.12);
}

.section-heading h1 {
    font-size: var(--panda-type-page-title);
    line-height: var(--panda-type-page-title-line-height);
}

.player-form {
    min-width: min(100%, 36.75rem);
}

.player-form .input-group {
    flex-wrap: nowrap;
    align-items: stretch;
}

.player-form .input-group .panda-btn {
    flex: 0 0 12.2rem;
    margin-left: 1.65rem !important;
    border-radius: var(--panda-control-radius) !important;
}

.player-form .form-label,
.dashboard-filter-control .form-label {
    color: var(--panda-bamboo-dark) !important;
    letter-spacing: 0.06em;
}

.input-group-text {
    min-height: var(--panda-control-min-height);
    border-color: var(--panda-control-border);
    border-radius: var(--panda-control-radius);
    background-color: var(--panda-surface);
}

.input-group-text {
    color: #1b1f21;
}

.btn-dark.panda-btn {
    border-color: var(--panda-bamboo);
    background: var(--panda-bamboo);
}

.btn-dark.panda-btn:hover {
    border-color: var(--panda-bamboo-dark);
    background: var(--panda-bamboo-dark);
}

#dashboard-status .alert,
.dashboard-status-card {
    border: 1px solid rgba(120, 154, 75, 0.24) !important;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, rgba(238, 244, 232, 0.96), rgba(255, 255, 255, 0.95));
    color: #33471f;
}

#product-dashboard-status:empty {
    display: none;
}

.dashboard-status-card {
    min-height: 3.9rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    font-weight: 700;
}

.dashboard-status-card img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
}

.dashboard-status-card--danger,
.dashboard-status-card--warning {
    border-color: rgba(199, 125, 62, 0.28) !important;
    background: #fff8ec;
    color: #6d401b;
}

.dashboard-filter-bar {
    margin-top: 1.2rem;
    align-items: end;
}

.dashboard-filter-bar h4 {
    position: relative;
    padding: 0 0 1.2rem 0.15rem;
    font-size: var(--panda-type-section-title);
}

.dashboard-filter-bar h4::after {
    content: "";
    position: absolute;
    left: 0.15rem;
    bottom: 0.55rem;
    width: 3.6rem;
    height: 2px;
    background: var(--panda-bamboo);
}

.dashboard-filter-controls {
    gap: 1.7rem;
}

.dashboard-filter-control {
    min-width: 10.2rem;
}

.dashboard-side-control {
    min-width: 12rem;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.stat-card {
    border-radius: var(--panda-surface-radius);
    background: var(--panda-surface);
}

/* Training plan mockup */
.training-plan-page .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.nav-item--training-parent,
.nav-item--opening-parent {
    display: block;
    margin: 0.55rem 0 0.08rem;
}

.nav-item--training-parent .nav-link,
.nav-item--opening-parent .nav-link {
    min-height: 1.28rem;
    padding: 0 0.95rem 0 1.18rem;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-item--training-parent .nav-link i:first-child,
.nav-item--opening-parent .nav-link i:first-child {
    display: none;
}

.nav-item--training-parent.active,
.nav-item--opening-parent.active {
    background: transparent;
    box-shadow: none;
}

.nav-item--training-parent.active .nav-link,
.nav-item--training-parent.active .nav-link i,
.nav-item--opening-parent.active .nav-link,
.nav-item--opening-parent.active .nav-link i {
    color: rgba(255, 255, 255, 0.86);
}

.nav-disclosure {
    margin-left: auto;
    font-size: 0.5rem !important;
}

.nav-item--training-child,
.nav-item--opening-child {
    position: relative;
    margin-left: 1.32rem;
    margin-top: 0.12rem;
}

.nav-item--training-child::before,
.nav-item--opening-child::before {
    content: "";
    position: absolute;
    left: -0.48rem;
    top: -0.3rem;
    bottom: -0.3rem;
    width: 1px;
    background: rgba(255, 255, 255, 0.10);
}

.nav-item--training-child .nav-link,
.nav-item--opening-child .nav-link {
    margin-left: 0;
    min-height: 2.7rem;
    padding: 0.62rem 0.85rem 0.62rem 0.78rem;
    font-size: 0.82rem;
}

.nav-item--training-child .nav-link i,
.nav-item--opening-child .nav-link i {
    width: 1.5rem;
    font-size: 1.08rem;
}

.nav-item--training-child.active,
.nav-item--opening-child.active {
    background: linear-gradient(100deg, rgba(64, 92, 32, 0.9), rgba(74, 103, 42, 0.72));
    box-shadow: inset 0 0 0 1px rgba(172, 210, 101, 0.35), 0 12px 28px rgba(0, 0, 0, 0.18);
}

.is-training-plan-view .nav-list {
    margin-top: 2rem !important;
}

.is-training-plan-view .nav-item--training-parent {
    display: none;
}

.is-training-plan-view .nav-item--training-child {
    margin-left: 0;
}

.is-training-plan-view .nav-item--training-child::before {
    display: none;
}

.is-training-plan-view .nav-item--training-child .nav-link,
.is-training-plan-view .nav-item:not(.nav-item--training-parent) .nav-link {
    min-height: 3.75rem !important;
    font-size: 0.78rem !important;
}

.is-training-plan-view .nav-item--training-child .nav-link i,
.is-training-plan-view .nav-item:not(.nav-item--training-parent) .nav-link i {
    font-size: 1.55rem !important;
}

@media (min-width: 992px) {
    :root {
        --sidebar-rail-width: 76px;
    }

    .sidebar {
        z-index: 1200;
        width: var(--sidebar-rail-width);
        transition: width 0.22s ease, box-shadow 0.22s ease;
    }

    .sidebar:hover,
    .sidebar:has(:focus-visible) {
        width: var(--sidebar-width);
        box-shadow: 22px 0 42px rgba(17, 19, 19, 0.24);
    }

    .main-content {
        width: calc(100% - var(--sidebar-rail-width));
        margin-left: var(--sidebar-rail-width);
        transition: margin-left 0.22s ease, width 0.22s ease;
    }

    .app-container:has(.sidebar:hover) .main-content,
    .app-container:has(.sidebar :focus-visible) .main-content {
        width: calc(100% - var(--sidebar-width));
        margin-left: var(--sidebar-width);
    }

    .sidebar-header {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .sidebar:hover .sidebar-header,
    .sidebar:has(:focus-visible) .sidebar-header {
        padding-right: 2.15rem;
        padding-left: 1.95rem;
    }

    .logo {
        justify-content: center;
    }

    .sidebar:hover .logo,
    .sidebar:has(:focus-visible) .logo {
        justify-content: flex-start;
    }

    .logo-copy,
    .nav-link span,
    .nav-disclosure,
    .nav-paw,
    .sidebar-footer {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.14s ease;
    }

    .logo-copy,
    .nav-link span {
        max-width: 0;
        overflow: hidden;
        white-space: nowrap;
    }

    .nav-paw {
        width: 0;
        margin-left: 0;
        overflow: hidden;
    }

    .sidebar:hover .logo-copy,
    .sidebar:hover .nav-link span,
    .sidebar:hover .nav-disclosure,
    .sidebar:hover .nav-paw,
    .sidebar:hover .sidebar-footer,
    .sidebar:has(:focus-visible) .logo-copy,
    .sidebar:has(:focus-visible) .nav-link span,
    .sidebar:has(:focus-visible) .nav-disclosure,
    .sidebar:has(:focus-visible) .nav-paw,
    .sidebar:has(:focus-visible) .sidebar-footer {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar:hover .logo-copy,
    .sidebar:has(:focus-visible) .logo-copy {
        max-width: 11rem;
    }

    .sidebar:hover .nav-link span,
    .sidebar:has(:focus-visible) .nav-link span {
        max-width: 12rem;
    }

    .sidebar:hover .nav-paw,
    .sidebar:has(:focus-visible) .nav-paw {
        width: 1.45rem;
        margin-left: auto;
        pointer-events: auto;
    }

    .nav-list {
        padding-right: 0.45rem;
        padding-left: 0.45rem;
    }

    .sidebar:hover .nav-list,
    .sidebar:has(:focus-visible) .nav-list {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .nav-item--training-child,
    .nav-item--opening-child {
        margin-left: 0;
    }

    .nav-item--training-child::before,
    .nav-item--opening-child::before {
        opacity: 0;
    }

    .sidebar:hover .nav-item--training-child,
    .sidebar:hover .nav-item--opening-child,
    .sidebar:has(:focus-visible) .nav-item--training-child,
    .sidebar:has(:focus-visible) .nav-item--opening-child {
        margin-left: 1.32rem;
    }

    .sidebar:hover .nav-item--training-child::before,
    .sidebar:hover .nav-item--opening-child::before,
    .sidebar:has(:focus-visible) .nav-item--training-child::before,
    .sidebar:has(:focus-visible) .nav-item--opening-child::before {
        opacity: 1;
    }

    .nav-link {
        justify-content: center;
        padding-right: 0.6rem;
        padding-left: 0.6rem;
    }

    .sidebar:hover .nav-link,
    .sidebar:has(:focus-visible) .nav-link {
        justify-content: flex-start;
        padding-right: 0.95rem;
        padding-left: 1.18rem;
    }

    .sidebar:hover .nav-item--training-child .nav-link,
    .sidebar:hover .nav-item--opening-child .nav-link,
    .sidebar:has(:focus-visible) .nav-item--training-child .nav-link,
    .sidebar:has(:focus-visible) .nav-item--opening-child .nav-link {
        padding-right: 0.85rem;
        padding-left: 0.78rem;
    }

    .nav-link i {
        flex: 0 0 1.9rem;
    }

    .sidebar::after {
        opacity: 0;
    }

    .sidebar:hover::after,
    .sidebar:has(:focus-visible)::after {
        opacity: 0.88;
    }
}

.training-plan-page {
    position: relative;
    width: min(calc(100% + 0.55rem), 88rem);
    min-height: calc(100vh - 1rem);
    margin-left: -0.55rem;
    padding: 3.25rem 0 3.4rem;
}

.training-plan-page::before {
    content: "";
    position: absolute;
    right: -28px;
    top: -12px;
    width: min(50rem, 62vw);
    height: 16rem;
    opacity: 0.8;
    background:
        linear-gradient(90deg, rgba(250, 251, 247, 1) 0%, rgba(250, 251, 247, 0.88) 18%, rgba(250, 251, 247, 0) 43%),
        url("assets/training-plan/hero-scene.png?v=99") right top / contain no-repeat;
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.18) 14%, #000 38%, #000 100%),
        linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.18) 14%, #000 38%, #000 100%),
        linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
    mask-composite: intersect;
    pointer-events: none;
}

.training-plan-page > * {
    position: relative;
    z-index: 1;
}

.training-plan-header {
    min-height: 9rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.training-plan-header__copy {
    padding-left: 0.45rem;
}

.training-plan-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    color: #080909;
    font-size: 3rem;
    line-height: 0.98;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.training-plan-header h1 img,
.focus-themes-card h2 img,
.journey-card h2 img,
.theme-education-card h2 img {
    width: 2.35rem;
    height: 2.35rem;
    object-fit: contain;
}

.focus-themes-card h2 img,
.journey-card h2 img,
.theme-education-card h2 img {
    width: 2.15rem;
    height: 2.15rem;
}

.training-plan-header p {
    margin: 1.45rem 0 0;
    color: #3f4a57;
    font-size: 1.12rem;
    line-height: 1.35;
}

.training-plan-start {
    min-width: 12rem;
    min-height: 3.2rem;
    margin: 0.28rem min(15.4rem, 17.3vw) 0 0;
    padding: 0 1.55rem;
    border-radius: 0.55rem;
    background: #385f1f !important;
    border-color: #385f1f !important;
    box-shadow: 0 12px 24px rgba(38, 71, 25, 0.20);
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
}

.training-plan-start i {
    color: #ffffff;
    font-size: 1.25rem;
}

.training-plan-layout {
    display: grid;
    grid-template-columns: 35.9375rem 28.8125rem;
    gap: 1.875rem;
    align-items: stretch;
}

.training-plan-left {
    display: grid;
    grid-template-rows: 34.35rem 16.1rem;
    gap: 1.875rem;
    align-content: start;
}

.focus-themes-card,
.theme-education-card,
.journey-card {
    border: 1px solid rgba(17, 19, 19, 0.11);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 17px 34px rgba(31, 35, 28, 0.10);
}

.focus-themes-card {
    height: 34.35rem;
    min-height: 0;
    padding: 1.38rem 1.45rem 0.55rem;
}

.focus-themes-card h2,
.journey-card h2,
.theme-education-card h2 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: #080909;
    font-size: 1.28rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.focus-themes-list {
    display: grid;
}

.focus-theme-row {
    display: grid;
    grid-template-columns: 4.75rem 12.1rem auto auto;
    align-items: center;
    gap: 0.8rem;
    min-height: 9.65rem;
    border-bottom: 1px solid rgba(17, 19, 19, 0.11);
}

.focus-theme-row:last-child {
    border-bottom: 0;
}

.focus-theme-row__icon {
    width: 4.75rem;
    height: 4.75rem;
    display: block;
    border-radius: 50%;
    background-image: url("assets/training-plan/focus-icons.png?v=99");
    background-repeat: no-repeat;
    background-size: 300% 100%;
    background-position: 0 50%;
    box-shadow: inset 0 0 0 1px rgba(85, 115, 46, 0.10);
}

.focus-theme-row__icon--rook {
    background-position: 50% 50%;
}

.focus-theme-row__icon--recapture {
    background-position: 100% 50%;
}

.focus-theme-row h3 {
    margin: 0;
    color: #111313;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.focus-theme-row p {
    max-width: 19.5rem;
    margin: 0.45rem 0 0;
    color: #384353;
    font-size: 0.82rem;
    line-height: 1.44;
}

.focus-theme-row__impact {
    min-width: 6.8rem;
    display: inline-flex;
    justify-content: center;
    padding: 0.48rem 0.7rem;
    border-radius: 0.5rem;
    font-weight: 800;
    font-size: 0.78rem;
    white-space: nowrap;
}

.focus-theme-row__impact--high {
    background: #fde2e5;
    color: #d31b2e;
}

.focus-theme-row__impact--medium {
    background: #fff1d9;
    color: #aa5a00;
}

.focus-theme-row__impact--low {
    background: #ecf4df;
    color: #4a6f24;
}

.focus-theme-row__learn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 5.8rem;
    margin-left: 0.75rem;
    border: 0;
    background: transparent;
    color: #3c641f;
    font-weight: 800;
    font-size: 0.74rem;
    white-space: nowrap;
}

.focus-themes-empty {
    min-height: 27.8rem;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.7rem;
    padding: 2rem;
    color: #384353;
    text-align: center;
}

.focus-themes-empty i {
    width: 4.25rem;
    height: 4.25rem;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #edf4e3;
    color: #456724;
    font-size: 1.7rem;
}

.focus-themes-empty h3 {
    margin: 0;
    color: #111313;
    font-size: 1.05rem;
    font-weight: 800;
}

.focus-themes-empty p {
    max-width: 20rem;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
}

.theme-education-card {
    position: relative;
    height: 16.1rem;
    min-height: 14.1rem;
    display: grid;
    grid-template-columns: 11.5rem minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    padding: 0 1.9rem 0 0;
}

.theme-education-card::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 3px;
    z-index: 0;
    width: 185px;
    height: calc(100% - 3px);
    background: url("assets/training-plan/themes-panda-official-edgefade.png?v=105") left top / 100% 100% no-repeat;
    pointer-events: none;
}

.theme-education-card > img {
    display: none;
}

.theme-education-card > div {
    position: relative;
    z-index: 1;
    grid-column: 2;
    transform: translateY(0.25rem);
}

.theme-education-card p {
    max-width: 28rem;
    margin: 1rem 0 1.25rem;
    color: #384353;
    font-size: 0.88rem;
    line-height: 1.6;
}

.theme-education-card .panda-btn {
    width: min(100%, 14.6rem);
    min-height: 3.7rem;
    margin-left: min(8rem, calc(100% - 14.6rem));
    border-color: #4e742d;
    color: #3e641f;
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: normal;
    text-transform: none;
}

.theme-education-card .button-paw {
    width: 1.5rem;
    height: 1.5rem;
}

.journey-card {
    position: relative;
    min-height: 52.25rem;
    overflow: hidden;
    padding: 1.4rem 1.95rem 1.75rem;
}

.journey-card__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url("assets/training-plan/journey-base.png?v=108") center top / 100% 100% no-repeat;
    opacity: 1;
    filter: none;
}

.journey-card__content {
    position: relative;
    z-index: 1;
    min-height: 100%;
}

.training-plan-debug-button {
    position: absolute;
    right: 0.15rem;
    bottom: 0.1rem;
    z-index: 8;
    min-height: 1.6rem;
    padding: 0.18rem 0.48rem;
    border: 1px solid rgba(78, 116, 45, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    color: #3e641f;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    text-transform: lowercase;
    box-shadow: 0 5px 12px rgba(31, 35, 28, 0.08);
}

.training-plan-debug-button:hover,
.training-plan-debug-button:focus-visible {
    background: #edf3e5;
    outline: none;
}

.journey-rating-card {
    position: absolute;
    top: 2.75rem;
    right: 0;
    left: auto;
    z-index: 3;
    width: 15.35rem;
    min-height: 6.75rem;
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 0.68rem;
    padding: 0.82rem;
    border: 1px solid rgba(17, 19, 19, 0.11);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.67);
    box-shadow: 0 12px 24px rgba(31, 35, 28, 0.08);
    backdrop-filter: blur(2px);
}

.journey-rating-card > span {
    width: 2.85rem;
    height: 2.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #edf3e5;
    color: #55732e;
    font-size: 1.22rem;
}

.journey-rating-card p {
    margin: 0;
    color: #435061;
    font-weight: 800;
    font-size: 0.9rem;
}

.journey-rating-card strong {
    display: inline-block;
    margin-top: 0.1rem;
    color: #080909;
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 800;
}

.journey-rating-card em {
    display: inline-flex;
    margin-left: 0.35rem;
    padding: 0.24rem 0.55rem;
    border-radius: 0.35rem;
    background: #e4f0dc;
    color: #385f1f;
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 800;
}

.journey-rating-card small {
    display: block;
    margin-top: 0.4rem;
    color: #3f4a57;
    font-size: 0.68rem;
    line-height: 1.28;
}

.journey-map {
    position: absolute;
    inset: 0;
}

.journey-stalk {
    position: absolute;
    left: var(--stalk-label-x);
    top: var(--stalk-label-y);
    z-index: 5;
}

.journey-stalk__label {
    position: relative;
    width: 8.2rem;
    color: #111313;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.56);
}

.journey-stalk strong,
.journey-stalk span {
    display: block;
}

.journey-stalk strong {
    color: #31372d;
    font-size: 0.82rem;
    font-weight: 700;
}

.journey-stalk--current strong {
    color: #405f20;
}

.journey-stalk span {
    font-size: 0.72rem;
    font-weight: 640;
}

.journey-panda {
    position: absolute;
    left: var(--panda-x);
    top: var(--panda-y);
    z-index: 4;
    width: 10.2rem;
    transform: translate(-50%, -82%);
    filter: drop-shadow(0 16px 14px rgba(31, 35, 28, 0.22));
}

.journey-card--moving .journey-panda {
    animation: journeyPandaAdvance 1.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.journey-card--moving .journey-stalk--current .journey-stalk__label {
    animation: journeyPlatformUnlock 1.55s ease-out both;
}

@media (min-width: 992px) {
    .is-training-plan-view .nav-item--training-child.active .nav-link {
        min-height: 3.72rem;
    }

    .is-training-plan-view .nav-item[data-view="rapid"] {
        margin-top: 0.28rem;
    }

    .is-training-plan-view .nav-item[data-view="analyzer"],
    .is-training-plan-view .nav-item[data-view="profile"] {
        margin-top: 1.35rem;
    }
}

@keyframes journeyPandaIdle {
    0%, 100% { transform: translate(-50%, -82%) translateY(0); }
    50% { transform: translate(-50%, -82%) translateY(-0.45rem); }
}

@keyframes journeyPandaAdvance {
    0% {
        left: var(--panda-prev-x);
        top: var(--panda-prev-y);
        transform: translate(-50%, -82%) scale(0.96);
    }
    48% {
        transform: translate(-50%, -98%) scale(1.02) rotate(-2deg);
    }
    100% {
        left: var(--panda-x);
        top: var(--panda-y);
        transform: translate(-50%, -82%) scale(1);
    }
}

@keyframes journeyPlatformUnlock {
    0% { filter: brightness(1); transform: scale(0.96); }
    45% { filter: brightness(1.18) saturate(1.25); transform: scale(1.08); }
    100% { filter: brightness(1); transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .journey-panda,
    .journey-card--moving .journey-panda,
    .journey-card--moving .journey-stalk--current .journey-stalk__label {
        animation: none;
    }
}

@media (max-width: 1399.98px) {
    .training-plan-page {
        width: 100%;
        margin-left: 0;
    }

    .training-plan-page::before {
        width: min(44rem, 53vw);
        height: 14rem;
    }

    .training-plan-start {
        margin-right: min(10rem, 14vw);
    }

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

    .training-plan-left {
        grid-template-rows: auto;
    }

    .journey-card {
        width: min(100%, 28.8125rem);
        min-height: 52.25rem;
        margin-inline: auto;
    }

    .journey-map {
        inset: 0;
    }
}

@media (max-width: 1199.98px) {
    :root {
        --sidebar-width: 285px;
    }

    .main-content {
        padding-right: 1.6rem;
        padding-left: 1.6rem;
    }

    .category-summary-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .opening-analyzer-field-grid--setup,
    .opening-analyzer-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (min-width: 992px) and (max-height: 960px) {
    .sidebar::after {
        top: 28.9rem;
        height: 13.8rem;
    }
}

@media (min-width: 992px) and (max-height: 820px) {
    .sidebar-header {
        padding: 2rem 2rem 1.25rem;
    }

    .logo-mark--sidebar {
        width: 4.25rem;
        height: 4.25rem;
        flex-basis: 4.25rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .logo-subtitle {
        font-size: 0.6rem;
    }

    .nav-list {
        margin-top: 0.7rem !important;
    }

    .nav-item {
        margin: 0.32rem 0;
    }

    .nav-link {
        min-height: 2.95rem;
        padding: 0.68rem 0.95rem;
        font-size: 0.74rem;
    }

    .nav-link i {
        font-size: 1.06rem;
    }

    .sidebar::after {
        left: 2.05rem;
        top: 21.6rem;
        bottom: auto;
        width: 14.7rem;
        height: 14rem;
        opacity: 0.86;
    }

    .sidebar-footer {
        padding: 0.85rem 1rem 1rem;
    }

    .auth-panel {
        margin-bottom: 0.85rem;
    }

    .auth-user {
        min-height: 5rem;
        padding: 0.72rem 0.88rem;
    }

    .auth-avatar {
        width: 2.85rem;
        height: 2.85rem;
        flex-basis: 2.85rem;
    }

    .auth-logout-button {
        width: 100%;
        height: 2.75rem;
        flex-basis: 100%;
    }

    .user-pill {
        min-height: 3.85rem;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 0.5rem 1rem;
        box-shadow: none;
    }

    .sidebar::after {
        display: none;
    }

    .sidebar-header {
        padding: 0.5rem 0;
    }

    .logo-mark {
        width: 3.4rem;
        height: 3.4rem;
        flex-basis: 3.4rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-subtitle {
        display: none;
    }

    .nav-list {
        display: flex;
        flex-direction: row;
        width: 100%;
        margin: 0.55rem 0 0 !important;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0 0 0.2rem;
    }

    .nav-item {
        margin: 0 0.25rem;
    }

    .nav-link {
        min-height: 3rem;
        padding: 0.7rem 0.85rem;
        font-size: 0.94rem;
    }

    .nav-link i {
        width: auto;
        font-size: 1.25rem;
    }

    .nav-paw {
        display: none;
    }

    .sidebar-footer {
        padding: 0.7rem 0 0;
        border-top: none;
        margin-left: 0;
    }

    .auth-panel {
        display: none;
    }

    .app-container {
        flex-direction: column;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0 1.25rem 1.5rem;
    }

    .product-hero {
        min-height: 12rem;
        padding-top: 2rem;
    }

    .product-hero::after {
        width: 62%;
        height: 11rem;
    }

    .product-hero h1 {
        font-size: 2rem;
    }

    .category-summary-grid {
        gap: 1rem;
    }

    .onboarding-panel__content {
        align-items: stretch;
        flex-direction: column;
    }

    .onboarding-username-form,
    .bucket-metrics,
    .category-secondary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 0 0.85rem 1rem;
    }

    .product-hero {
        min-height: 10rem;
    }

    .product-hero__copy {
        max-width: 17rem;
    }

    .product-hero::after {
        width: 48%;
        height: 7.4rem;
        -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 34%, #000 100%);
        mask-image: linear-gradient(90deg, transparent 0%, #000 34%, #000 100%);
    }

    .product-hero h1 {
        font-size: 1.7rem;
    }

    .nav-list {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .nav-item {
        flex: 1 1 calc(50% - 0.5rem);
        margin: 0;
    }

    .nav-item--training-parent,
    .nav-item--opening-parent {
        flex-basis: 100%;
        margin-top: 0;
    }

    .nav-item--training-child,
    .nav-item--opening-child {
        margin-left: 0;
    }

    .nav-item--training-child::before,
    .nav-item--opening-child::before {
        display: none;
    }

    .nav-item--training-child .nav-link,
    .nav-item--opening-child .nav-link {
        margin-left: 0;
        padding-left: 0.85rem;
    }

    .training-plan-page {
        width: 100%;
        min-height: 0;
        padding: 2rem 0;
    }

    .training-plan-page::before {
        right: 0;
        width: 100%;
        height: 8.5rem;
        opacity: 0.52;
    }

    .training-plan-header {
        min-height: 0;
        flex-direction: column;
        gap: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .training-plan-header h1 {
        max-width: 19rem;
        font-size: 2.35rem;
        line-height: 1;
    }

    .training-plan-header p {
        margin-top: 0.75rem;
        font-size: 0.96rem;
    }

    .training-plan-start {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .training-plan-layout,
    .training-plan-left {
        width: 100%;
        gap: 1.25rem;
    }

    .focus-themes-card,
    .theme-education-card,
    .journey-card {
        border-radius: 0.78rem;
    }

    .focus-themes-card {
        height: auto;
        padding: 1.15rem 1rem 0.8rem;
    }

    .focus-themes-card h2,
    .journey-card h2,
    .theme-education-card h2 {
        font-size: 1.15rem;
    }

    .training-plan-header h1 img,
    .focus-themes-card h2 img,
    .journey-card h2 img,
    .theme-education-card h2 img {
        width: 1.65rem;
        height: 1.65rem;
    }

    .focus-theme-row {
        grid-template-columns: 3.85rem minmax(0, 1fr);
        gap: 0.55rem 0.75rem;
        min-height: 0;
        padding: 1.05rem 0;
    }

    .focus-theme-row__icon {
        width: 3.65rem;
        height: 3.65rem;
    }

    .focus-theme-row h3 {
        font-size: 0.96rem;
    }

    .focus-theme-row p {
        max-width: none;
        font-size: 0.82rem;
    }

    .focus-theme-row__impact,
    .focus-theme-row__learn {
        grid-column: 2;
        justify-self: start;
    }

    .focus-theme-row__impact {
        min-width: 0;
        padding: 0.38rem 0.58rem;
        font-size: 0.72rem;
    }

    .focus-theme-row__learn {
        min-width: 0;
        font-size: 0.72rem;
    }

    .theme-education-card {
        height: auto;
        min-height: 0;
        grid-template-columns: 1fr;
        padding: 10.9rem 1rem 1.1rem;
    }

    .theme-education-card > img {
        left: -0.8rem;
        top: -0.3rem;
        bottom: auto;
        width: 12.5rem;
    }

    .theme-education-card > div {
        grid-column: 1;
    }

    .theme-education-card p {
        font-size: 0.86rem;
    }

    .theme-education-card .panda-btn {
        width: 100%;
        margin-left: 0;
    }

    .journey-card {
        min-height: 46rem;
        padding: 1.15rem;
    }

    .journey-rating-card {
        right: 0;
        width: min(100%, 14rem);
        grid-template-columns: 2.6rem 1fr;
        padding: 0.72rem;
    }

    .journey-rating-card strong {
        font-size: 1.48rem;
    }

    .journey-rating-card small {
        font-size: 0.62rem;
    }

    .journey-panda {
        width: 8.1rem;
    }

    .journey-stalk__label {
        width: 6.2rem;
    }

    .journey-stalk strong {
        font-size: 0.74rem;
    }

    .journey-stalk span {
        font-size: 0.62rem;
    }

    .login-shell__content h1 {
        font-size: 1.85rem;
    }

    .product-hero p,
    .section-heading p {
        font-size: 0.95rem;
    }

    .onboarding-panel__content {
        padding: 1.2rem;
    }

    .loading-puzzle-launcher {
        align-items: stretch;
        flex-direction: column;
    }

    .loading-puzzle-launcher .panda-btn,
    .loading-puzzle-modal-actions .panda-btn {
        width: 100%;
    }

    #loading-puzzle-board-container {
        width: min(100%, 92vw);
        padding: 0.5rem;
    }

    .category-summary-card {
        min-height: auto;
        padding: 1.25rem;
    }

    .section-heading {
        align-items: flex-start;
    }

    .player-form {
        width: 100%;
    }

    .player-form .input-group {
        flex-direction: column;
        gap: 0.6rem;
    }

    .player-form .input-group > .form-control,
    .player-form .input-group > .panda-btn {
        width: 100%;
        border-radius: var(--panda-control-radius) !important;
    }

    .player-form .input-group .panda-btn {
        flex-basis: auto;
        margin-left: 0 !important;
    }

    .dashboard-filter-controls,
    .dashboard-filter-control,
    .dashboard-side-control {
        width: 100%;
    }
}

.nav-item--mobile-more,
.mobile-nav-scrim,
.mobile-nav-sheet {
    display: none;
}

.nav-link--button {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
}

/* Mobile app shell: use a native-feeling bottom app bar across every view. */
@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
    }

    .app-container {
        min-height: 100vh;
        flex-direction: column;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0 1.15rem 1.35rem;
    }

    .sidebar {
        position: fixed;
        right: 0.75rem;
        bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
        left: 0.75rem;
        z-index: 1500;
        display: block;
        width: auto;
        height: auto;
        padding: 0;
        overflow: visible;
        border: 1px solid rgba(24, 28, 22, 0.1);
        border-radius: 1.45rem;
        background: rgba(255, 255, 250, 0.98);
        box-shadow: 0 16px 44px rgba(20, 22, 18, 0.2);
        color: #20231e;
    }

    .sidebar::after,
    .sidebar-header,
    .sidebar-footer,
    .nav-item--training-parent,
    .nav-item--opening-parent,
    .nav-item--mobile-secondary,
    .nav-disclosure,
    .nav-paw {
        display: none !important;
    }

    .nav-item--mobile-more {
        display: block;
    }

    .sidebar .nav-list {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.24rem;
        width: 100%;
        margin: 0 !important;
        padding: 0.46rem;
        overflow-x: hidden;
        overflow-y: hidden;
    }

    .sidebar .nav-item,
    .sidebar .nav-item--training-child,
    .sidebar .nav-item--opening-child {
        min-width: 0;
        margin: 0;
        border-radius: 1rem;
    }

    .sidebar .nav-item--training-child::before,
    .sidebar .nav-item--opening-child::before {
        display: none;
    }

    .sidebar .nav-link,
    .sidebar .nav-item--training-child .nav-link,
    .sidebar .nav-item--opening-child .nav-link {
        display: grid;
        grid-template-rows: 1.45rem 0.86rem;
        justify-items: center;
        align-items: center;
        gap: 0.12rem;
        min-height: 4rem;
        padding: 0.48rem 0.25rem;
        border-radius: 1.05rem;
        color: rgba(32, 35, 30, 0.7);
        font-size: 0.68rem;
        font-weight: 780;
        line-height: 1;
        letter-spacing: 0;
        text-align: center;
        transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
    }

    .sidebar .nav-link i,
    .sidebar .nav-item--training-child .nav-link i,
    .sidebar .nav-item--opening-child .nav-link i {
        width: auto;
        font-size: 1.28rem;
        color: rgba(32, 35, 30, 0.62);
        transition: color 160ms ease, transform 160ms ease;
    }

    .sidebar .nav-link span {
        display: block;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        font-size: 0;
        line-height: 0;
        white-space: nowrap;
    }

    .sidebar .nav-link span::after {
        content: attr(data-mobile-label);
        display: block;
        overflow: hidden;
        font-size: 0.62rem;
        line-height: 1;
        text-overflow: ellipsis;
    }

    .sidebar .nav-item:hover,
    .sidebar .nav-item.active,
    .sidebar .nav-item--training-child.active,
    .sidebar .nav-item--opening-child.active {
        background: transparent;
        box-shadow: none;
    }

    .sidebar .nav-item.active:not(.nav-item--training-parent):not(.nav-item--opening-parent)::before {
        left: 25%;
        top: auto;
        right: 25%;
        bottom: 0.42rem;
        width: auto;
        height: 2px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: var(--panda-radius-pill, 999px);
    }

    .sidebar .nav-item.active .nav-link {
        background: linear-gradient(180deg, #789b49, #4f6f2f);
        color: #ffffff;
        box-shadow: 0 10px 20px rgba(72, 98, 42, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.24);
        transform: translateY(-0.16rem);
    }

    .sidebar .nav-item.active .nav-link i {
        color: #ffffff;
        transform: translateY(-0.03rem);
    }

    .sidebar .nav-item:not(.active) .nav-link:hover {
        background: rgba(109, 143, 66, 0.12);
        color: #20231e;
    }

    .sidebar .nav-item:not(.active) .nav-link:hover i {
        color: #4f6f2f;
    }

    .mobile-nav-scrim {
        position: fixed;
        inset: 0;
        z-index: 1490;
        display: block;
        background: rgba(12, 14, 12, 0.28);
    }

    .mobile-nav-sheet {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1600;
        display: block;
        padding: 0.55rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        border: 1px solid rgba(24, 28, 22, 0.1);
        border-bottom: 0;
        border-radius: 1.45rem 1.45rem 0 0;
        background: rgba(255, 255, 250, 0.98);
        box-shadow: 0 -20px 48px rgba(20, 22, 18, 0.22);
        color: #20231e;
    }

    .mobile-nav-scrim[hidden],
    .mobile-nav-sheet[hidden] {
        display: none !important;
    }

    .mobile-nav-sheet__handle {
        width: 2.5rem;
        height: 0.28rem;
        margin: 0 auto 0.85rem;
        border-radius: var(--panda-radius-pill, 999px);
        background: rgba(32, 35, 30, 0.18);
    }

    .mobile-nav-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.85rem;
    }

    .mobile-nav-sheet__header h2 {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 850;
        letter-spacing: 0;
    }

    .mobile-nav-sheet__close {
        display: inline-grid;
        place-items: center;
        width: 2.25rem;
        height: 2.25rem;
        border: 1px solid rgba(24, 28, 22, 0.1);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.84);
        color: #20231e;
    }

    .mobile-nav-sheet__actions {
        display: grid;
        gap: 0.55rem;
    }

    .mobile-nav-sheet__item {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
        min-height: 3.25rem;
        padding: 0.75rem 0.85rem;
        border: 1px solid rgba(24, 28, 22, 0.1);
        border-radius: 1rem;
        background: #ffffff;
        color: #20231e;
        font: inherit;
        font-size: 0.95rem;
        font-weight: 800;
        text-align: left;
        box-shadow: 0 8px 18px rgba(20, 22, 18, 0.06);
    }

    .mobile-nav-sheet__item i {
        display: inline-grid;
        place-items: center;
        width: 2.1rem;
        height: 2.1rem;
        border-radius: 0.85rem;
        background: rgba(109, 143, 66, 0.12);
        color: #4f6f2f;
        font-size: 1.05rem;
    }

    .mobile-nav-sheet__item.active {
        border-color: rgba(109, 143, 66, 0.48);
        background: rgba(239, 247, 232, 0.92);
        box-shadow: inset 0 0 0 1px rgba(109, 143, 66, 0.16), 0 10px 20px rgba(72, 98, 42, 0.12);
    }
}

@media (max-width: 575.98px) {
    body {
        padding-bottom: calc(5.95rem + env(safe-area-inset-bottom, 0px));
    }

    .main-content {
        padding: 0 0.85rem 1rem;
    }

    .sidebar {
        right: 0.55rem;
        bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
        left: 0.55rem;
        border-radius: 1.25rem;
    }

    .sidebar .nav-list {
        gap: 0.18rem;
        padding: 0.38rem;
    }

    .sidebar .nav-link,
    .sidebar .nav-item--training-child .nav-link,
    .sidebar .nav-item--opening-child .nav-link {
        min-height: 3.75rem;
        padding: 0.43rem 0.18rem;
    }

    .sidebar .nav-link span::after {
        font-size: 0.58rem;
    }

    .sidebar .nav-link i,
    .sidebar .nav-item--training-child .nav-link i,
    .sidebar .nav-item--opening-child .nav-link i {
        font-size: 1.15rem;
    }

    .opening-analyzer-page {
        gap: 0.9rem;
    }

    .opening-analyzer-hero,
    .opening-analyzer-panel {
        border-radius: 0.85rem;
    }

    .opening-analyzer-hero {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 1.15rem;
    }

    .opening-analyzer-hero h1 {
        font-size: 1.85rem;
    }

    .opening-analyzer-hero__mark {
        width: 4.6rem;
        height: 4.6rem;
    }

    .opening-analyzer-hero__mark img {
        width: 3.4rem;
        height: 3.4rem;
    }

    .opening-analyzer-field-grid--setup,
    .opening-analyzer-filter-grid,
    .opening-analyzer-run-grid,
    .opening-analyzer-scope,
    .opening-analyzer-category-grid,
    .opening-analyzer-months {
        grid-template-columns: 1fr;
    }

    .opening-analyzer-empty,
    .opening-analyzer-loading {
        align-items: flex-start;
    }
}

@media (max-width: 991.98px) and (max-height: 430px) and (orientation: landscape) {
    body {
        padding-bottom: calc(4.1rem + env(safe-area-inset-bottom, 0px));
    }

    .sidebar {
        right: 0.45rem;
        bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
        left: 0.45rem;
        border-radius: 1rem;
    }

    .sidebar .nav-list {
        gap: 0.12rem;
        padding: 0.28rem 0.42rem calc(0.28rem + env(safe-area-inset-bottom, 0px));
    }

    .sidebar .nav-link,
    .sidebar .nav-item--training-child .nav-link,
    .sidebar .nav-item--opening-child .nav-link {
        grid-template-rows: 1.05rem 0.68rem;
        min-height: 2.85rem;
        gap: 0.06rem;
        padding: 0.34rem 0.16rem;
    }

    .sidebar .nav-link i,
    .sidebar .nav-item--training-child .nav-link i,
    .sidebar .nav-item--opening-child .nav-link i {
        font-size: 1.05rem;
    }

    .sidebar .nav-link span::after {
        font-size: 0.49rem;
    }

    .sidebar .nav-item.active:not(.nav-item--training-parent):not(.nav-item--opening-parent)::before {
        bottom: 0.18rem;
        height: 2px;
    }
}

/* =========================================================
   UI Polish & Motion Layer
   Micro-interactions, entrance choreography, and visual
   refinements layered over the PandaTakes skin.
   ========================================================= */

:root {
    --motion-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Global texture ---------- */

::selection {
    background: rgba(120, 154, 75, 0.3);
    color: var(--panda-black);
}

html {
    scroll-behavior: smooth;
}

body {
    scrollbar-color: rgba(120, 154, 75, 0.45) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: var(--panda-radius-pill);
    background: rgba(17, 19, 19, 0.22);
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 154, 75, 0.6);
    background-clip: content-box;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--panda-bamboo);
    outline-offset: 2px;
}

/* ---------- View transitions ----------
   Entrances are opacity-only: transform-based entrances replay whenever a
   view's display toggles, which reads as the screen "refreshing". */

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

.app-view.active {
    animation: softIn 0.22s ease-out both;
}

.product-dashboard-shell > *,
.profile-settings-grid > *,
.grs-page > * {
    animation: softIn 0.4s ease-out both;
}

.product-dashboard-shell > *:nth-child(2),
.profile-settings-grid > *:nth-child(2),
.grs-page > *:nth-child(2) {
    animation-delay: 0.05s;
}

.product-dashboard-shell > *:nth-child(3),
.grs-page > *:nth-child(3) {
    animation-delay: 0.1s;
}

.product-dashboard-shell > *:nth-child(4),
.grs-page > *:nth-child(4) {
    animation-delay: 0.15s;
}

.product-dashboard-shell > *:nth-child(n + 5),
.grs-page > *:nth-child(n + 5) {
    animation-delay: 0.2s;
}

.category-summary-grid > * {
    animation: softIn 0.45s ease-out both;
    animation-delay: 0.16s;
}

.category-summary-grid > *:nth-child(2) {
    animation-delay: 0.24s;
}

/* Legacy markup-level entrance class: same opacity-only treatment. */
.fade-in-up {
    animation-name: softIn;
}

/* ---------- Sidebar choreography ---------- */

.logo-mark--sidebar {
    animation: pandaIdle 6s ease-in-out infinite;
}

@keyframes pandaIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.nav-item {
    position: relative;
}

.nav-link {
    transition: color 0.2s ease, transform 0.28s var(--motion-ease-out);
}

.nav-item:not(.nav-item--training-parent):not(.nav-item--opening-parent):hover .nav-link {
    transform: translateX(3px);
}

.nav-item.active .nav-link {
    transform: none;
}

.nav-link i {
    transition: color 0.2s ease, transform 0.3s var(--motion-ease-spring);
}

.nav-item:not(.nav-item--training-parent):not(.nav-item--opening-parent):hover .nav-link i {
    transform: scale(1.12);
}

.nav-item.active:not(.nav-item--training-parent):not(.nav-item--opening-parent)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: var(--panda-radius-pill);
    background: linear-gradient(180deg, #b9d780, var(--panda-bamboo));
    box-shadow: 0 0 10px rgba(173, 210, 110, 0.75);
    animation: navAccentIn 0.4s var(--motion-ease-out) both;
}

@keyframes navAccentIn {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

.nav-paw {
    transform: scale(0.4) rotate(-25deg);
    transition: opacity 0.25s ease, transform 0.35s var(--motion-ease-spring);
}

.nav-item.active .nav-paw {
    animation: pawPop 0.5s var(--motion-ease-spring) both;
}

@keyframes pawPop {
    0% { transform: scale(0.4) rotate(-25deg); }
    60% { transform: scale(1.2) rotate(8deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ---------- Buttons ---------- */

.panda-btn:active,
.panda-btn-lg:active,
.auth-button:active,
.grs-button:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

.panda-btn-lg {
    position: relative;
    overflow: hidden;
}

.panda-btn-lg::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -70%;
    width: 50%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}

.panda-btn-lg:hover::after {
    animation: btnSheen 0.75s ease;
}

@keyframes btnSheen {
    from { left: -70%; }
    to { left: 135%; }
}

.auth-button,
.auth-logout-button {
    transition: background-color 0.22s ease, border-color 0.22s ease, transform 0.22s var(--motion-ease-out), box-shadow 0.22s ease;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(120, 154, 75, 0.35);
}

/* ---------- Inputs ---------- */

.panda-input,
.input-group-text {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.panda-input:focus {
    border-color: var(--panda-bamboo-dark);
    box-shadow: 0 0 0 0.22rem rgba(120, 154, 75, 0.16);
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .panda-input {
    border-color: var(--panda-bamboo-dark);
}

.time-class-chip {
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s var(--motion-ease-out), box-shadow 0.2s ease;
}

.time-class-chip:not(.time-class-chip-static):hover {
    border-color: var(--panda-bamboo);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(22, 28, 20, 0.08);
}

.time-class-chip:has(input:checked) {
    border-color: var(--panda-bamboo);
    background: var(--panda-bamboo-soft);
}

/* ---------- Surfaces & cards ---------- */

.stat-card,
.category-summary-card,
.settings-panel,
.onboarding-panel {
    transition: transform 0.3s var(--motion-ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover,
.category-summary-card:hover,
.settings-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(120, 154, 75, 0.45);
    box-shadow: 0 20px 40px rgba(22, 28, 20, 0.14) !important;
}

.onboarding-panel:hover {
    border-color: rgba(120, 154, 75, 0.45);
}

.category-summary-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    height: 3px;
    background: linear-gradient(90deg, var(--panda-bamboo), #b9d780 60%, transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s var(--motion-ease-out);
}

.category-summary-card:hover::before {
    transform: scaleX(1);
}

.category-summary-card__icon {
    transition: transform 0.3s var(--motion-ease-spring);
}

.category-summary-card:hover .category-summary-card__icon {
    animation: iconBounce 0.55s var(--motion-ease-spring);
}

@keyframes iconBounce {
    0% { transform: scale(1) rotate(0deg); }
    40% { transform: scale(1.14) rotate(-7deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.settings-panel__icon {
    transition: transform 0.3s var(--motion-ease-spring);
}

.settings-panel:hover .settings-panel__icon {
    transform: rotate(-6deg) scale(1.07);
}

.opening-item {
    border: 1px solid transparent;
    transition: transform 0.25s var(--motion-ease-out), background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.opening-item:hover {
    transform: translateX(4px);
    background: var(--panda-white);
    border-color: rgba(120, 154, 75, 0.35);
    box-shadow: 0 6px 16px rgba(22, 28, 20, 0.08);
}

.dashboard-spinner-overlay {
    backdrop-filter: blur(3px);
}

/* ---------- Status & pills ---------- */

.status-pill {
    gap: 0.45rem;
}

.status-pill::before {
    content: "";
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: currentColor;
    animation: pillPulse 2.4s ease-in-out infinite;
}

@keyframes pillPulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.78); }
}

.product-status,
.dashboard-status-card {
    animation: softIn 0.35s ease-out both;
}

.onboarding-panel__art {
    position: relative;
}

.onboarding-panel__art::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: artPing 2.8s ease-out infinite;
}

@keyframes artPing {
    0% { box-shadow: 0 0 0 0 rgba(120, 154, 75, 0.35); }
    70% { box-shadow: 0 0 0 16px rgba(120, 154, 75, 0); }
    100% { box-shadow: 0 0 0 0 rgba(120, 154, 75, 0); }
}

/* ---------- Empty states ---------- */

.empty-category-state {
    border: 1px dashed rgba(120, 154, 75, 0.45);
    background: linear-gradient(180deg, var(--panda-white) 0%, rgba(238, 244, 232, 0.55) 100%);
}

.empty-category-state i {
    width: 4.5rem;
    height: 4.5rem;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--panda-bamboo-soft);
    color: var(--panda-bamboo-dark);
    font-size: 1.9rem;
    box-shadow: 0 12px 26px rgba(120, 154, 75, 0.2);
    animation: emptyFloat 3.8s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

/* ---------- Loaders ---------- */

.panda-loader-inner {
    border-color: rgba(120, 154, 75, 0.18);
    border-top-color: var(--panda-bamboo);
    animation: spin 0.85s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.panda-loader::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 3px solid transparent;
    border-bottom-color: var(--panda-bamboo-dark);
    border-radius: 50%;
    animation: spinReverse 1.4s linear infinite;
}

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

/* ---------- Modals ---------- */

.modal.fade .modal-dialog {
    transform: translateY(22px) scale(0.96);
    transition: transform 0.35s var(--motion-ease-out);
}

.modal.show .modal-dialog {
    transform: none;
}

/* ---------- Hero & headings ---------- */

.product-hero::after {
    animation: heroIn 0.8s ease-out both;
}

@keyframes heroIn {
    from { opacity: 0; }
    to { opacity: 0.96; }
}

.title-sprig {
    transform-origin: bottom left;
    animation: sprigSway 5s ease-in-out infinite;
}

@keyframes sprigSway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(6deg); }
}

.section-heading__avatar {
    transition: transform 0.3s var(--motion-ease-spring);
}

.section-heading:hover .section-heading__avatar {
    transform: rotate(-5deg) scale(1.06);
}

.filter-section-title i {
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.5rem;
    background: var(--panda-bamboo-soft);
    color: var(--panda-bamboo-dark);
    font-size: 0.95rem;
}

/* ---------- Opening analyzer ---------- */

.opening-analyzer-page {
    display: grid;
    gap: 1.15rem;
    width: min(100%, 88rem);
    margin-inline: auto;
}

.opening-analyzer-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.2rem;
    min-height: 11.5rem;
    overflow: hidden;
    padding: 1.4rem 1.55rem;
    border: 1px solid rgba(17, 19, 19, 0.12);
    border-radius: var(--panda-radius-lg);
    background:
        linear-gradient(135deg, rgba(17, 19, 19, 0.96), rgba(37, 60, 34, 0.94)),
        var(--panda-black);
    color: var(--panda-white);
    box-shadow: 0 18px 42px rgba(18, 25, 18, 0.16);
}

.opening-analyzer-hero .product-eyebrow {
    margin-bottom: 0.45rem;
    color: var(--panda-bamboo-light);
    letter-spacing: 0;
}

.opening-analyzer-hero h1 {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 850;
    line-height: 1.04;
}

.opening-analyzer-hero p:last-child {
    max-width: 38rem;
    margin: 0.55rem 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.98rem;
    line-height: 1.5;
}

.opening-analyzer-hero__mark {
    display: grid;
    place-items: center;
    width: 7.25rem;
    height: 7.25rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.opening-analyzer-hero__mark img {
    width: 5.4rem;
    height: 5.4rem;
    object-fit: contain;
}

.opening-analyzer-form {
    display: grid;
    gap: 1rem;
}

.opening-analyzer-panel {
    min-width: 0;
    padding: 1.1rem;
    border: 1px solid var(--panda-surface-border);
    border-radius: var(--panda-radius-lg);
    background: var(--panda-surface);
    box-shadow: var(--panda-surface-shadow);
}

.opening-analyzer-panel__header {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.opening-analyzer-panel__icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 2.55rem;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 0.75rem;
    background: var(--panda-bamboo-soft);
    color: var(--panda-bamboo-dark);
    font-size: 1.05rem;
}

.opening-analyzer-panel__icon--blue {
    background: #e8f3fb;
    color: #25638e;
}

.opening-analyzer-panel__icon--gold {
    background: #fff4d8;
    color: #8a5a00;
}

.opening-analyzer-panel h2 {
    margin: 0;
    color: #121515;
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.2;
}

.opening-analyzer-panel p {
    margin: 0.22rem 0 0;
    color: #66715f;
    font-size: 0.87rem;
    line-height: 1.45;
}

.opening-analyzer-field-grid,
.opening-analyzer-filter-grid,
.opening-analyzer-run-grid {
    display: grid;
    gap: 0.85rem;
}

.opening-analyzer-field-grid--setup {
    grid-template-columns: minmax(14rem, 1.08fr) minmax(8rem, 0.55fr) minmax(17rem, 1.25fr);
}

.opening-analyzer-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.34fr);
    gap: 1rem;
    align-items: start;
}

.opening-analyzer-filter-grid {
    grid-template-columns: minmax(13rem, 0.75fr) minmax(14rem, 1fr) minmax(16rem, 1.08fr);
}

.opening-analyzer-field--archive,
.opening-analyzer-field--scope {
    min-width: 0;
}

.opening-analyzer-field .form-label {
    margin-bottom: 0.42rem;
    color: #5c6658;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.opening-analyzer-field .form-label.small {
    margin-bottom: 0.35rem;
    color: #778173 !important;
    font-size: 0.68rem;
}

.opening-analyzer-input-group .input-group-text {
    color: #6d7864;
}

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

.opening-analyzer-category-grid .time-class-chip {
    min-height: 3rem;
    border-color: rgba(17, 19, 19, 0.1);
    background: #fbfcfa;
}

.opening-analyzer-category-grid .time-class-chip span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.opening-analyzer-category-grid .time-class-chip i {
    color: var(--panda-bamboo-dark);
}

.opening-analyzer-months {
    gap: 0.6rem;
}

.opening-analyzer-scope {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 0.35rem;
    padding: 0.35rem;
    border: 1px solid rgba(17, 19, 19, 0.1);
    border-radius: 0.75rem;
    background: #f7faf5;
}

.opening-analyzer-scope .scope-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 0;
    min-height: 2.65rem;
    margin: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    color: #30372d;
    font-size: 0.88rem;
    font-weight: 850;
}

.opening-analyzer-scope .scope-label:has(input:checked) {
    border-color: rgba(79, 109, 47, 0.22);
    background: var(--panda-white);
    color: var(--panda-bamboo-dark);
    box-shadow: 0 6px 14px rgba(41, 58, 36, 0.08);
}

.opening-analyzer-scope .last-matches-input {
    width: 3.4rem;
    min-height: 1.85rem;
    padding-inline: 0.25rem;
}

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

.opening-analyzer-submit {
    margin-top: 1rem;
}

.opening-analyzer-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    border: 1px solid var(--panda-surface-border);
    border-radius: var(--panda-radius-lg);
    background: var(--panda-white);
    box-shadow: var(--panda-surface-shadow);
}

.opening-analyzer-loading.d-none {
    display: none !important;
}

.opening-analyzer-loading h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 850;
}

.opening-analyzer-loading p {
    margin: 0.2rem 0 0;
    color: #66715f;
    font-size: 0.9rem;
}

.opening-analyzer-results {
    min-width: 0;
}

.opening-analyzer-empty {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 6.25rem;
    padding: 1.25rem;
    border: 1px dashed rgba(79, 109, 47, 0.34);
    border-radius: var(--panda-radius-lg);
    background:
        linear-gradient(135deg, rgba(238, 244, 232, 0.9), rgba(255, 255, 255, 0.95)),
        var(--panda-white);
    color: #293321;
}

.opening-analyzer-empty > i {
    display: inline-grid;
    place-items: center;
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.8rem;
    background: var(--panda-white);
    color: var(--panda-bamboo-dark);
    font-size: 1.2rem;
    box-shadow: 0 8px 18px rgba(47, 68, 39, 0.1);
}

.opening-analyzer-empty h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 850;
}

.opening-analyzer-empty p {
    margin: 0.25rem 0 0;
    color: #68715f;
    font-size: 0.9rem;
}

/* ---------- Analyzer results ---------- */

#results > * {
    animation: softIn 0.45s ease-out both;
}

#results > *:nth-child(2) { animation-delay: 0.08s; }
#results > *:nth-child(3) { animation-delay: 0.16s; }
#results > *:nth-child(4) { animation-delay: 0.24s; }
#results > *:nth-child(n + 5) { animation-delay: 0.3s; }

/* ---------- Game review motion ---------- */

.grs-card {
    transition: transform 0.3s var(--motion-ease-out), box-shadow 0.3s ease, border-color 0.3s ease;
}

.grs-card:hover {
    transform: translateY(-3px);
    border-color: rgba(91, 138, 60, 0.4);
    box-shadow: 0 12px 28px rgba(28, 36, 23, 0.1);
}

.grs-evalgraph__line {
    stroke-dasharray: 4000;
    stroke-dashoffset: 4000;
    animation: grsDraw 1.7s 0.35s ease-out forwards;
}

@keyframes grsDraw {
    to { stroke-dashoffset: 0; }
}

.grs-donut__chart svg {
    animation: softIn 0.6s ease-out both;
}

.grs-moments__list > * {
    animation: softIn 0.4s ease-out both;
}

.grs-moments__list > *:nth-child(2) { animation-delay: 0.05s; }
.grs-moments__list > *:nth-child(3) { animation-delay: 0.1s; }
.grs-moments__list > *:nth-child(4) { animation-delay: 0.15s; }
.grs-moments__list > *:nth-child(n + 5) { animation-delay: 0.2s; }

.grs-moments__item {
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.25s var(--motion-ease-out);
}

.grs-moments__item:hover {
    transform: translateX(4px);
}

.grs-stepper__step.is-current .grs-stepper__dot {
    position: relative;
}

.grs-stepper__step.is-current .grs-stepper__dot::after {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid rgba(47, 85, 36, 0.4);
    animation: stepPing 2.1s ease-out infinite;
}

@keyframes stepPing {
    0% { transform: scale(0.72); opacity: 1; }
    100% { transform: scale(1.18); opacity: 0; }
}

/* ---------- Login shell ---------- */

.login-shell__brand,
.login-shell__content > * {
    animation: fadeInUp 0.6s var(--motion-ease-out) both;
}

.login-shell__content > *:nth-child(2) { animation-delay: 0.08s; }
.login-shell__content > *:nth-child(3) { animation-delay: 0.16s; }
.login-shell__content > *:nth-child(n + 4) { animation-delay: 0.24s; }

/* ---------- Wide screens ----------
   Center the content shells instead of leaving a dead zone on the right of
   large monitors, and let the dashboard breathe a little wider. */

.product-dashboard-shell,
#legacy-dashboard-content {
    width: min(100%, 78rem);
    margin-inline: auto;
}

.category-plan-view {
    width: min(100%, 88.55rem);
    margin-inline: auto;
}

#view-analyzer > *,
#view-opening-insights > *,
#view-profile > * {
    width: min(100%, 80rem);
    margin-inline: auto;
}

@media (min-width: 1640px) {
    /* Anchor the hero artwork to the centered shell instead of the viewport
       edge so it stays attached to the content. */
    .product-hero::after {
        inset: 0 0 auto auto;
    }

    /* The training plan's inner layout uses fixed-width columns, so the page
       itself must shrink-wrap to that content or everything sits left of a
       wide centered container. */
    .training-plan-page {
        width: min(100%, 70.5rem);
        margin-left: auto;
        margin-right: auto;
    }

    .training-plan-page::before {
        right: 0;
    }

    .training-plan-start {
        margin-right: 0.55rem;
    }
}

/* ---------- Category identities ----------
   Blitz reads warm (flame), Rapid reads cool (clock), matching the existing
   category chip palette. */

.category-summary-card--blitz .category-summary-card__icon {
    background: linear-gradient(135deg, #e89a4a, #c25c1d);
}

.category-summary-card--rapid .category-summary-card__icon {
    background: linear-gradient(135deg, #5b93cf, #2e5e97);
}

.category-summary-card--blitz::before {
    background: linear-gradient(90deg, #d9772e, #f0b46a 60%, transparent);
}

.category-summary-card--rapid::before {
    background: linear-gradient(90deg, #3f72ad, #8db9e6 60%, transparent);
}

/* ---------- Reduced motion ---------- */

@media (max-width: 575.98px) {
    .product-dashboard-shell > *,
    .grs-page > *,
    .category-summary-grid > *,
    .fade-in-up {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}
