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

:root {
  --green-dark: #1a7a4a;
  --green-mid: #2db56e;
  --green-light: #e8f8ef;
  --green-pale: #f3fbf6;
  --teal: #4dd4ac;
  --blue-accent: #1565c0;
  --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, 0.08);
  --shadow-card: 0 4px 20px rgba(30, 100, 60, 0.1);
  --sidebar-w: 240px;
  --font: "Nunito", sans-serif;
}

body {
  font-family: var(--font);
  background: var(--green-pale);
  color: var(--text-main);
  min-height: 100dvh;
}

img {
  display: block;
  max-width: 100%;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

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

.desktop-sidebar {
  display: none;
}

.desktop-header {
  display: none;
}

.scroll-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.scroll-content::-webkit-scrollbar {
  display: none;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  background: var(--green-pale);
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-header h1 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-points {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border: 1.5px solid var(--green-mid);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}
.badge-points .dot {
  width: 10px;
  height: 10px;
  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: var(--text-main);
}

.name-bar {
  margin: 0 16px 16px;
  background: var(--green-dark);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.name-bar span {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
}
.name-bar svg {
  color: var(--white);
  opacity: 0.85;
}

.section {
  padding: 0 16px;
  margin-bottom: 16px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}
.link-arrow {
  display: flex;
  align-items: center;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.summary-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-card);
}
.ring-wrap {
  flex-shrink: 0;
  position: relative;
  width: 90px;
  height: 90px;
}
.ring-wrap svg {
  width: 90px;
  height: 90px;
  transform: rotate(-90deg);
}
.ring-wrap circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}
.ring-track {
  stroke: #e0f0e8;
}
.ring-sleep {
  stroke: var(--teal);
  stroke-dasharray: 180 220;
}
.ring-steps {
  stroke: var(--green-mid);
  stroke-dasharray: 140 220;
}
.ring-exercise {
  stroke: var(--green-dark);
  stroke-dasharray: 100 220;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring-legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ring-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}
.ring-legend li::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ring-legend .l-sleep::before {
  background: var(--teal);
}
.ring-legend .l-steps::before {
  background: var(--green-mid);
}
.ring-legend .l-exercise::before {
  background: var(--green-dark);
}
.ring-legend .l-sleep {
  color: var(--teal);
}
.ring-legend .l-steps {
  color: var(--green-mid);
}
.ring-legend .l-exercise {
  color: var(--green-dark);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-label);
  font-weight: 600;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--blue-accent);
  line-height: 1.1;
}
.stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
}
.btn-pill.alert {
  background: var(--green-mid);
}

.banner {
  margin: 0 16px 16px;
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  min-height: 160px;
  background: linear-gradient(135deg, var(--green-dark) 0%, #2db56e 100%);
  display: flex;
  align-items: flex-end;
}
.banner-content {
  position: relative;
  z-index: 1;
  padding: 18px;
  color: var(--white);
}
.banner-content h2 {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 6px;
}
.banner-content p {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-bottom: 12px;
}
.btn-outline-white {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--white);
  color: var(--white);
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
}
.carousel-dots {
  position: absolute;
  bottom: 12px;
  right: 16px;
  display: flex;
  gap: 5px;
  z-index: 2;
}
.carousel-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.carousel-dots span.active {
  background: var(--white);
}

.tips-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.tips-scroll::-webkit-scrollbar {
  display: none;
}
.tip-card {
  flex: 0 0 46%;
  background: var(--green-light);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tip-card h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--green-dark);
}
.tip-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.tip-paragraph {
  padding: 0 16px 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.shop-card-link {
  text-decoration: none;
  display: block;
}
.shop-card {
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  transition: transform 0.15s;
}
.shop-card:hover {
  transform: translateY(-2px);
}
.shop-card-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-card-content h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}
.shop-card-price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--green-dark);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid #e0ede5;
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(30, 100, 60, 0.08);
}
.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: 0.72rem;
  font-weight: 700;
  border: none;
  background: none;
  font-family: var(--font);
  cursor: pointer;
}
.nav-item svg {
  width: 24px;
  height: 24px;
}
.nav-item.active {
  color: var(--green-dark);
}
.nav-item.active svg {
  stroke: var(--green-dark);
}

.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: 0.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, 0.65);
    font-size: 0.92rem;
    font-weight: 700;
    transition: background 0.15s, color 0.15s;
  }
  .sidebar-link:hover,
  .sidebar-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
  }
  .sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  .sidebar-badge {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 0.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, 0.08);
    font-size: 0.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;
  }
}
