.habits {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px 90px;
}

.habit-wrap {
  position: relative;
  margin-bottom: 8px;
}

.habit-card {
  border-radius: 22px;
  padding: 16px 20px;
  min-height: 96px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}

.habit-card.completed {
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #f2fff8 55%,
    #e7fff1 100%
  );

  box-shadow:
    0 14px 35px rgba(0, 0, 0, .06),
    0 0 26px rgba(34, 197, 94, .16);
}

.habit-card.pending {
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #fff8ec 55%,
    #fff0d3 100%
  );

  box-shadow:
    0 14px 35px rgba(0, 0, 0, .06),
    0 0 26px rgba(244, 163, 0, .18);
}

.habit-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.habit-info {
  gap: 10px;
  max-width: 48%;
}

.habit-name {
  font-size: 15px;
  line-height: 1.15;
  font-weight: 800;
  color: #050505;
}

.habit-streak {
  font-size: 13px;
  font-weight: 500;
  color: #050505;
}

.habit-streak span {
  color: #050505 !important;
  font-weight: 500;
}

.habit-chart {
  width: 50%;
  height: 68px;
  margin-top: 8px;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  filter: none !important;
}

.habit-overlay {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);

  transition:
    max-height .45s ease,
    opacity .25s ease,
    transform .35s ease;
}

.habit-wrap.active .habit-overlay {
  max-height: 520px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 10px;
}

.calendar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: start;

  padding: 14px;
  background: #ffffff;

  border-radius: 18px;

  box-shadow:
    0 10px 28px rgba(0, 0, 0, .06);
}

.calendar-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 9px);
  row-gap: 2px;

  font-size: 9px;
  color: #8b8f9c;
}

.calendar-weekdays div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.grid {
  display: grid;
  grid-template-rows: repeat(7, 9px);
  grid-auto-flow: column;
  grid-auto-columns: 9px;
  gap: 2px;
}

.grid.year {
  grid-template-rows: repeat(7, 9px);
  grid-auto-columns: 9px;

  overflow-x: auto;
  overflow-y: hidden;

  padding-bottom: 14px;
}

.cell {
  width: 9px;
  height: 9px;

  border-radius: 3px;
  background: #eef0f5;

  transition: background .2s;
}

.cell.active {
  background: #22c55e;
}

.cell.today {
  border: 1px solid #f4a300;
  background: #fff;
  animation: todayPulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(244, 163, 0, .45);
}

.cell.today-done {
  background: #22c55e;
  animation: todayPulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(34, 197, 94, .65);
}

.grid.year::-webkit-scrollbar {
  height: 3px;
}

.grid.year::-webkit-scrollbar-track {
  background: transparent;
}

.grid.year::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .25);
  border-radius: 10px;
}

.habit-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-top: 12px;
}

.switch {
  display: flex;

  background: #f2f0ff;
  border-radius: 12px;
  overflow: hidden;
}

.switch-btn {
  border: none;
  background: none;

  padding: 8px 14px;

  color: #6b7280;
  font-weight: 600;
}

.switch-btn.active {
  background: #5b35e6;
  color: #fff;
}

.progress {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}

@keyframes todayPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}