@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0a0c10;
    --bg-card: #121620;
    --border-color: #1e2538;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    
    --primary: #d97706; /* Gold/Amber */
    --primary-glow: rgba(217, 119, 6, 0.15);
    --secondary: #2563eb; /* Cobalt Blue */
    --secondary-glow: rgba(37, 99, 235, 0.15);
    --success: #10b981; /* Emerald Green */
    --error: #ef4444; /* Rose Red */
    
    --font-sans: 'Outfit', sans-serif;
    --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}
a:hover {
    filter: brightness(1.2);
}

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

/* Sidebar navigation */
.sidebar {
    width: 280px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.logo-section {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2.5rem;
    letter-spacing: -0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-heart {
    color: var(--primary);
    -webkit-text-fill-color: initial;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-link:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-glow), transparent);
    border-color: rgba(217, 119, 6, 0.3);
    color: var(--primary);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 0.6rem;
    text-align: center;
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.logout-btn:hover {
    border-color: var(--error);
    color: var(--error);
    background-color: rgba(239, 68, 68, 0.05);
}

/* Main Content panel */
.main-panel {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2.5rem;
    min-height: 100vh;
    /* flex items refuse to shrink below content min-width without this,
       which breaks every inner overflow-x scroll container */
    min-width: 0;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* Grid systems */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
}

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

/* Cards & panels */
.panel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0.7;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Forms */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-size: 0.95rem;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: #f59e0b;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-block {
    display: flex;
    width: 100%;
}

.alert-message {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert-info {
    background-color: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--secondary);
}

/* Feed items */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.feed-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.feed-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.feed-body {
    flex-grow: 1;
}

.feed-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Scoreboard */
.scoreboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.score-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-progress {
    flex-grow: 1;
    height: 8px;
    background-color: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.score-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
}

/* Mobile topbar (hidden on desktop) */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
}

.mobile-topbar .topbar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.25rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 55;
}

/* Off-canvas sidebar below 1024px */
@media (max-width: 1024px) {
    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 60;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .main-panel {
        margin-left: 0;
        padding: 1.25rem;
        padding-top: calc(56px + 1.25rem);
    }

    .header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .header-bar > * {
        min-width: 0;
        max-width: 100%;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .dashboard-grid {
        gap: 1.5rem;
    }

    .panel-card {
        padding: 1.25rem;
    }
}

/* Toggle switch — single implementation for every on/off control */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #374151;
    border-radius: 12px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    cursor: not-allowed;
}

/* Habits dashboard grid */
.habits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.habit-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    transition: var(--transition-smooth);
}

.habit-card.completed {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(16, 185, 129, 0.02));
}

.habit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.habit-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.habit-points {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--primary-glow);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.habit-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: auto;
    padding-bottom: 1rem;
}

.habit-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.habit-shell {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 0 1rem;
}

.habit-level-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.habit-level-card,
.habit-board-card,
.habit-unlocks,
.habit-skill-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.habit-level-card {
    padding: 1.35rem;
}

.habit-level-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.habit-level-top h2 {
    font-size: 1.5rem;
}

.habit-level-badge,
.habit-rank {
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    color: var(--primary);
    background-color: var(--primary-glow);
    font-weight: 800;
    white-space: nowrap;
}

.habit-xp-bar {
    height: 10px;
    margin-top: 1.25rem;
    background-color: var(--bg-dark);
    border-radius: 999px;
    overflow: hidden;
}

.habit-xp-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.habit-level-meta,
.habit-next {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 0.8rem;
}

.habit-next {
    flex-direction: column;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.habit-next strong {
    color: var(--text-main);
}

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

.habit-unlock {
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.02);
}

.habit-unlock::after {
    content: "Locked";
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
}

.habit-unlock.unlocked {
    color: var(--text-main);
    border-color: rgba(16, 185, 129, 0.3);
    background-color: rgba(16, 185, 129, 0.06);
}

.habit-unlock.unlocked::after {
    content: "Unlocked";
    color: var(--success);
}

.habit-unlock.boss {
    border-color: rgba(217, 119, 6, 0.35);
}

.habit-skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.habit-skill-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem;
}

.habit-skill-card.locked {
    border-color: rgba(217, 119, 6, 0.45);
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.08), rgba(255, 255, 255, 0.02));
}

.habit-skill-card span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.habit-skill-card strong {
    display: block;
    font-size: 1.05rem;
}

.habit-skill-card small {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
    margin-top: 0.1rem;
}

.habit-skill-card .habit-paywall {
    color: var(--primary);
    font-weight: 800;
}

.habit-board-card {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.habit-board-scroll {
    overflow-x: auto;
}

.habit-board {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0.28rem;
}

.habit-board th {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-align: center;
    font-weight: 800;
}

.habit-board th:first-child,
.habit-board td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background-color: var(--bg-card);
    z-index: 1;
}

.habit-board-name {
    min-width: 210px;
    padding-right: 0.75rem;
}

.habit-board-name strong,
.habit-board-name span {
    display: block;
}

.habit-board-name span,
.habit-board-score span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.habit-cell {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
}

.habit-cell.done {
    color: white;
    border-color: rgba(16, 185, 129, 0.4);
    background-color: var(--success);
}

.habit-cell .material-icons {
    font-size: 1rem;
}

.habit-board-score {
    min-width: 74px;
    text-align: center;
}

.habit-board-score strong {
    display: block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Sport workspace */
.sport-shell {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 0 1rem;
}

.sport-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.25rem;
}

.sport-kicker {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.sport-subtitle {
    color: var(--text-muted);
    max-width: 680px;
    font-size: 0.98rem;
    margin-top: 0.35rem;
}

.sport-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.sport-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0 1.5rem;
    margin-bottom: 0.25rem;
}

.sport-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.02);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.sport-tab .material-icons {
    font-size: 1.05rem;
}

.sport-tab.active,
.sport-tab:hover {
    color: var(--text-main);
    border-color: rgba(217, 119, 6, 0.45);
    background-color: var(--primary-glow);
    filter: none;
}

.sport-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 1.5rem;
    align-items: start;
}

.sport-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sport-form-shell {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 0 1rem;
}

.sport-session-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.sport-form-grid {
    display: grid;
    grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
    gap: 1rem;
}

.sport-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sport-log-row {
    display: grid;
    grid-template-columns: 110px minmax(220px, 1.4fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(170px, 1fr);
    gap: 0.75rem;
    align-items: end;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
}

.sport-log-row.is-skipped {
    opacity: 0.72;
    background-color: rgba(239, 68, 68, 0.04);
}

.sport-log-main {
    min-width: 0;
}

.sport-sticky-submit {
    width: 100%;
    margin-top: 0.4rem;
}

.sport-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.35rem;
    position: relative;
    overflow: hidden;
}

.sport-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sport-card-title h2,
.sport-card-title h3 {
    font-size: 1.05rem;
    line-height: 1.2;
}

.sport-card-title .material-icons {
    color: var(--primary);
}

.sport-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.sport-metric {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem;
    background-color: rgba(255, 255, 255, 0.02);
}

.sport-metric-label {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sport-metric-value {
    color: var(--text-main);
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 0.25rem;
}

.sport-metric-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.sport-workout {
    border: 1px solid rgba(217, 119, 6, 0.35);
    border-radius: 8px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(37, 99, 235, 0.06));
}

.sport-workout-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.sport-workout-name {
    font-size: 1.2rem;
    font-weight: 800;
}

.sport-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sport-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.sport-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 28px;
    padding: 0.22rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.sport-blocker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sport-body-map {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: center;
}

.sport-body-view {
    text-align: center;
    min-width: 0;
}

.sport-body-view svg {
    max-width: 100%;
    height: auto;
}

.sport-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
}

.sport-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    margin-right: 0.3rem;
}

.sport-recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.sport-recovery-scroll {
    max-height: 560px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.sport-recovery-group h3 {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.65rem;
}

.sport-recovery-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sport-recovery-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    min-height: 38px;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.sport-recovery-row span:first-child {
    min-width: 0;
}

.sport-recovery-row small {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 0.1rem;
}

.sport-status {
    flex: 0 0 auto;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
}

.sport-status.ready {
    color: var(--success);
    background-color: rgba(16, 185, 129, 0.1);
}

.sport-status.recovering {
    color: var(--secondary);
    background-color: var(--secondary-glow);
}

.sport-status.worked {
    color: var(--error);
    background-color: rgba(239, 68, 68, 0.1);
}

.sport-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sport-month-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sport-session {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
}

.sport-session-main {
    min-width: 0;
}

.sport-session-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.sport-session-title {
    color: var(--text-main);
    font-weight: 800;
}

.sport-exercise-list {
    margin-top: 0.45rem;
    padding-left: 1rem;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.sport-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.sport-empty .material-icons {
    font-size: 2.6rem;
    margin-bottom: 0.75rem;
}

.sport-filter-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.sport-exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.sport-exercise-card {
    display: flex;
    min-height: 118px;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    background-color: var(--bg-card);
}

.sport-exercise-card:hover {
    border-color: rgba(217, 119, 6, 0.45);
    background-color: rgba(217, 119, 6, 0.06);
    filter: none;
}

.sport-exercise-card span,
.sport-exercise-card small {
    color: var(--text-muted);
}

.sport-exercise-media {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 8px;
    background-color: white;
}

.sport-instruction-list {
    padding-left: 1.25rem;
    color: var(--text-muted);
}

.sport-instruction-list li + li {
    margin-top: 0.45rem;
}

.sport-heatmap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sport-heatmap-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(26px, 1fr));
    gap: 0.35rem;
}

.sport-heatmap-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
}

.sport-heatmap-day.low {
    background-color: var(--success);
    color: white;
}

.sport-heatmap-day.medium {
    background-color: var(--primary);
    color: white;
}

.sport-heatmap-day.high {
    background-color: var(--error);
    color: white;
}

.program-card.active {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, var(--bg-card), rgba(16, 185, 129, 0.04));
}

.program-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
}

.program-workouts {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.program-workout {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.measurement-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.measurement-photo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.measurement-photo {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mm-poly[data-muscle] {
    cursor: pointer;
    transition: opacity 0.12s ease;
}

.mm-poly[data-muscle]:hover {
    opacity: 0.7;
}

.mm-row-highlight {
    animation: mm-pulse 1.4s ease;
}

@keyframes mm-pulse {
    0% { box-shadow: 0 0 0 2px var(--primary); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

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

@media (max-width: 760px) {
    .sport-shell {
        padding: 0;
    }

    .habit-shell {
        padding: 0;
    }

    .habit-level-grid {
        grid-template-columns: 1fr;
    }

    .habit-unlocks {
        grid-template-columns: 1fr;
    }

    .sport-hero,
    .program-header {
        grid-template-columns: 1fr;
    }

    .sport-actions {
        justify-content: stretch;
    }

    .sport-actions .btn,
    .sport-workout-header .btn,
    .sport-sticky-submit {
        width: 100%;
    }

    .sport-form-shell {
        padding: 0;
    }

    .sport-form-grid,
    .sport-log-row,
    .sport-filter-form {
        grid-template-columns: 1fr;
    }

    .sport-log-row {
        align-items: stretch;
    }

    .sport-sticky-submit {
        position: sticky;
        bottom: 0.75rem;
        z-index: 5;
    }

    .sport-workout-header,
    .sport-session-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .sport-metric-grid,
    .sport-body-map {
        grid-template-columns: 1fr;
    }

    .sport-recovery-scroll {
        max-height: 420px;
    }
}

@media print {
    .sidebar,
    .mobile-topbar,
    .sidebar-backdrop,
    .sport-tabs,
    .sport-actions {
        display: none !important;
    }

    .main-panel {
        margin-left: 0;
        padding: 0;
    }

    body {
        background: white;
        color: #111827;
    }

    .sport-card,
    .sport-metric {
        break-inside: avoid;
        border-color: #d1d5db;
    }
}
