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

:root {
    --green-dark: #1a7a4a;
    --green-mid: #2db56e;
    --green-soft: #24a07d;
    --green-light: #dff5ec;
    --green-pale: #f5fbf8;
    --lime: #9fd34f;
    --lime-soft: #b9df6f;
    --text-main: #1a2e1f;
    --text-muted: #6b8f71;
    --text-label: #888;
    --white: #ffffff;
    --radius-card: 18px;
    --radius-pill: 999px;
    --shadow-soft: 0 2px 12px rgba(30, 100, 60, .08);
    --shadow-card: 0 8px 24px rgba(30, 100, 60, .10);
    --font: 'Nunito', sans-serif;
}

body {
    font-family: var(--font);
    background: #f0f7f3;
    color: var(--text-main);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

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

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

.app {
  width: 100%;
  min-height: 100dvh;
  background: var(--green-pale);
  display: flex;
  flex-direction: column;
  padding-bottom: 72px;
}

.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 24px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 16px 14px;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-header h1 {
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -.4px;
    color: #3e4346;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-points {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f8fff9;
    border: 1.5px solid #cbe9d8;
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    font-size: .96rem;
    font-weight: 800;
    color: #7bc26f;
    box-shadow: 0 2px 8px rgba(45, 181, 110, .08);
}

.badge-points .dot {
    width: 8px;
    height: 8px;
    background: var(--green-mid);
    border-radius: 50%;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #77c96f;
}

.page-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* .section {
    padding: 0 16px;
} */

.avatar-tabs-section {
    margin-bottom: 2px;
}

.avatar-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.avatar-tabs::-webkit-scrollbar {
    display: none;
}

.tab-pill {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    border: 1.5px solid #d9e6df;
    background: var(--white);
    color: #c6d7cc;
    font-size: .95rem;
    font-weight: 800;
    text-decoration: none;
    line-height: 1;
}

.tab-pill.active {
    background: linear-gradient(135deg, var(--green-mid), #20a96a);
    border-color: transparent;
    color: var(--white);
    box-shadow: var(--shadow-soft);
}

.profile-progress-section {
    padding-top: 14px;
}

.profile-progress-card {
    background: linear-gradient(135deg, var(--green-mid), var(--green-soft));
    border-radius: 22px;
    padding: 12px 14px;
    box-shadow: var(--shadow-card);
    color: var(--white);
}

.profile-progress-card h3 {
    font-size: 1.05rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.profile-progress-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.goal-track {
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg, rgba(196, 236, 171, .92), rgba(30, 160, 120, .98));
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}

.goal-track-large {
    height: 12px;
    background: rgba(255, 255, 255, .96);
}

.goal-fill {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--lime) 0%, #a8d85b 52%, #92c945 100%);
    color: var(--white);
    white-space: nowrap;
}

.goal-fill strong {
    font-size: .72rem;
    font-weight: 900;
    padding-right: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .14);
}

.goal-fill-main {
    background: linear-gradient(90deg, #84ca6a 0%, #8fce6f 100%);
}

.goal-side-icon,
.goal-target {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1db18b;
    flex-shrink: 0;
}

.goal-side-icon svg,
.goal-target svg {
    width: 100%;
    height: 100%;
}

.goal-target-soft {
    color: #9dcb49;
}

.goals-panel {
    background: linear-gradient(180deg, #fbfffd 0%, #f6fffa 100%);
    border-radius: 26px;
    padding: 18px 14px 14px;
    box-shadow: 0 10px 28px rgba(71, 161, 120, .10);
}

.goals-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.goals-panel-header h2 {
    color: #2c9c7d;
    font-size: 1.1rem;
    font-weight: 900;
    flex-shrink: 0;
}

.panel-line {
    flex: 1;
    height: 5px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, #2aa584 0%, #228f77 100%);
}

.goals-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.goal-item {
    width: 100%;
}

.goal-row {
    display: grid;
    grid-template-columns: 26px 1fr 30px;
    gap: 10px;
    align-items: center;
}

.goal-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #21a07b;
}

.goal-icon svg {
    width: 100%;
    height: 100%;
}

.goal-bar-wrap {
    min-width: 0;
}

.action-section {
    padding-top: 8px;
}

.primary-action {
    width: 100%;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, #24a07d 0%, #1f9a73 100%);
    color: var(--white);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
}

.primary-action svg {
    width: 24px;
    height: 24px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    /* max-width: 420px; */
    background: var(--white);
    border-top: 1px solid #eaf0ec;
    display: flex;
    z-index: 100;
    box-shadow: 0 -8px 26px rgba(30, 100, 60, .08);
    /* border-radius: 50px; */
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 12px;
    gap: 3px;
    text-decoration: none;
    color: #4b4f52;
    font-size: .72rem;
    font-weight: 800;
    background: none;
    font-family: var(--font);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--green-mid);
}

.nav-item.active svg {
    stroke: var(--green-mid);
}

.desktop-sidebar {
    display: none;
}

.desktop-header {
    display: none;
}

.desktop-header {
    display: none;
}

@media (min-width: 768px) {
    body {
        display: flex;
        min-height: 100vh;
        background: #eef6f1;
    }

    .desktop-sidebar {
        display: flex;
        flex-direction: column;
        width: 240px;
        min-height: 100vh;
        background: #1a7a4a;
        padding: 32px 20px 24px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 200;
        gap: 8px;
    }

    .sidebar-logo {
        font-size: 1.5rem;
        font-weight: 900;
        color: #fff;
        letter-spacing: .15em;
        margin-bottom: 32px;
        padding: 0 8px;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
    }

    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 14px;
        border-radius: 12px;
        text-decoration: none;
        color: rgba(255, 255, 255, .65);
        font-size: .92rem;
        font-weight: 700;
        transition: background .15s, color .15s;
    }

    .sidebar-link:hover,
    .sidebar-link.active {
        background: rgba(255, 255, 255, .18);
        color: #fff;
    }

    .sidebar-link svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .sidebar-badge {
        margin-top: auto;
        background: rgba(255, 255, 255, .12);
        border-radius: 12px;
        padding: 12px 14px;
        display: flex;
        align-items: center;
        gap: 8px;
        color: #fff;
        font-size: .85rem;
        font-weight: 800;
    }

    .sidebar-badge .dot {
        width: 10px;
        height: 10px;
        background: #2db56e;
        border-radius: 50%;
    }

    .app {
        margin-left: 240px;
        width: calc(100% - 240px);
        max-width: none;
        min-height: 100vh;
        padding-bottom: 0;
        background: transparent;
    }

    .app-header {
        display: none;
    }

    .name-bar {
        display: none;
    }

    .bottom-nav {
        display: none;
    }

    .scroll-content {
        overflow: visible;
        max-height: none;
        padding: 0 36px 36px;
    }

    .desktop-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 28px 36px 20px;
    }

    .desktop-header h1 {
        font-size: 1.9rem;
        font-weight: 900;
        color: #1a2e1f;
    }

    .desktop-header-right {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .desktop-user-pill {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #fff;
        border-radius: 999px;
        padding: 8px 16px;
        box-shadow: 0 2px 12px rgba(30, 100, 60, .08);
        font-size: .9rem;
        font-weight: 800;
        color: #1a2e1f;
    }

    .desktop-user-pill .dot {
        width: 10px;
        height: 10px;
        background: #2db56e;
        border-radius: 50%;
    }

    .section {
        padding: 0;
        margin-bottom: 24px;
    }

    .section-header {
        margin-bottom: 14px;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .banner {
        margin: 0;
        border-radius: 18px;
    }

    .tips-scroll {
        flex-wrap: wrap;
        overflow: visible;
    }

    .tip-card {
        flex: 0 0 calc(50% - 6px);
    }

    .tip-paragraph {
        padding: 4px 0 0;
    }

    .bar-chart {
        height: 160px;
    }

    .chart-box {
        border-radius: 18px;
        padding: 24px;
    }

    .meals-list,
    .exercise-list {
        gap: 14px;
    }

    .meal-item,
    .exercise-item {
        padding: 18px 20px;
        border-radius: 18px;
    }

    .meal-thumb,
    .ex-thumb {
        width: 54px;
        height: 54px;
    }

    .desktop-grid {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 24px;
        align-items: start;
    }

    .desktop-main {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .desktop-aside {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .shop-card {
        padding: 18px;
        gap: 18px;
    }

    .shop-card-image {
        width: 90px;
        height: 90px;
    }

    .summary-card {
        padding: 24px;
        gap: 28px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 1.7rem;
    }
}

@media (min-width: 1100px) {
    .scroll-content {
        padding: 0 44px 44px;
    }

    .desktop-header {
        padding: 28px 44px 20px;
    }

    .desktop-grid {
        grid-template-columns: 1fr 340px;
        gap: 28px;
    }

    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .tip-card {
        flex: 0 0 calc(33.33% - 8px);
    }

    .bar-chart {
        height: 180px;
    }
}

@media (max-width: 380px) {
    .app-header {
        padding-inline: 14px;
    }
}